diff --git a/akonadi/tests/unittestenv/config.xml b/akonadi/tests/unittestenv/config.xml deleted file mode 100644 index 63e56fd09..000000000 --- a/akonadi/tests/unittestenv/config.xml +++ /dev/null @@ -1,8 +0,0 @@ - - kdehome - xdgconfig - xdglocal - akonadi_knut_resource - akonadi_knut_resource - akonadi_knut_resource - diff --git a/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_0rc b/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_0rc deleted file mode 100644 index ca9b407ad..000000000 --- a/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_0rc +++ /dev/null @@ -1,3 +0,0 @@ -[General] -DataFile[$e]=$KDEHOME/testdata-res1.xml - diff --git a/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_1rc b/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_1rc deleted file mode 100644 index 49a63a668..000000000 --- a/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_1rc +++ /dev/null @@ -1,3 +0,0 @@ -[General] -DataFile[$e]=$KDEHOME/testdata-res2.xml - diff --git a/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_2rc b/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_2rc deleted file mode 100644 index 22447eeff..000000000 --- a/akonadi/tests/unittestenv/kdehome/share/config/akonadi_knut_resource_2rc +++ /dev/null @@ -1,3 +0,0 @@ -[General] -DataFile[$e]=$KDEHOME/testdata-res3.xml - diff --git a/akonadi/tests/unittestenv/kdehome/testdata-res1.xml b/akonadi/tests/unittestenv/kdehome/testdata-res1.xml deleted file mode 100644 index 6a10d3938..000000000 --- a/akonadi/tests/unittestenv/kdehome/testdata-res1.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - testmailbody - From: <test@user.tst> - - - testmailbody1 - From: <test1@user.tst> - - - testmailbody2 - From: <test2@user.tst> - - - testmailbody3 - From: <test3@user.tst> - - - testmailbody4 - From: <test4@user.tst> - - - testmailbody5 - From: <test5@user.tst> - - - testmailbody6 - From: <test6@user.tst> - - - testmailbody7 - From: <test7@user.tst> - - - testmailbody8 - From: <test8@user.tst> - - - testmailbody9 - From: <test9@user.tst> - - - testmailbody10 - From: <test10@user.tst> - - - testmailbody11 - From: <test11@user.tst> - - - testmailbody12 - From: <test12@user.tst> - - - testmailbody13 - From: <test13@user.tst> - - - testmailbody14 - From: <test14@user.tst> - - - - diff --git a/akonadi/tests/unittestenv/kdehome/testdata-res2.xml b/akonadi/tests/unittestenv/kdehome/testdata-res2.xml deleted file mode 100644 index 0925ac943..000000000 --- a/akonadi/tests/unittestenv/kdehome/testdata-res2.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/akonadi/tests/unittestenv/kdehome/testdata-res3.xml b/akonadi/tests/unittestenv/kdehome/testdata-res3.xml deleted file mode 100644 index 0c3b7a8c0..000000000 --- a/akonadi/tests/unittestenv/kdehome/testdata-res3.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/akonadi/tests/unittestenv/kdehome/testdata.xml b/akonadi/tests/unittestenv/kdehome/testdata.xml deleted file mode 100644 index 3cd2f4871..000000000 --- a/akonadi/tests/unittestenv/kdehome/testdata.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - testmailbody - From: <test@user.tst> - - - testmailbody1 - From: <test1@user.tst> - - - testmailbody2 - From: <test2@user.tst> - - - testmailbody3 - From: <test3@user.tst> - - - testmailbody4 - From: <test4@user.tst> - - - testmailbody5 - From: <test5@user.tst> - - - testmailbody6 - From: <test6@user.tst> - - - testmailbody7 - From: <test7@user.tst> - - - testmailbody8 - From: <test8@user.tst> - - - testmailbody9 - From: <test9@user.tst> - - - testmailbody10 - From: <test10@user.tst> - - - testmailbody11 - From: <test11@user.tst> - - - testmailbody12 - From: <test12@user.tst> - - - testmailbody13 - From: <test13@user.tst> - - - testmailbody14 - From: <test14@user.tst> - - - - - - - - - diff --git a/kholidays/.krazy b/kholidays/.krazy deleted file mode 100644 index 728ff248e..000000000 --- a/kholidays/.krazy +++ /dev/null @@ -1,2 +0,0 @@ -EXTRA kdebug,null,style,defines,qenums -SKIP /scanholiday\|/parseholiday diff --git a/kholidays/CMakeLists.txt b/kholidays/CMakeLists.txt deleted file mode 100644 index 633b3e3b4..000000000 --- a/kholidays/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -project(libkholidays) - -add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5350) - -add_subdirectory(holidays) -add_subdirectory(tests) - -check_include_files(err.h HAVE_ERR_H) -check_include_files(sys/cdefs.h HAVE_SYS_CDEFS_H) -configure_file(config-libkholidays.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-libkholidays.h) - -########### next target ############### - -set(kholidays_LIB_SRCS - #holiday.cpp - kholidays.cpp - scanholiday.c - parseholiday.h - parseholiday.c - astroseasons.cpp - lunarphase.cpp - zodiac.cpp - #us.cpp -) - -kde4_add_library(kholidays SHARED ${kholidays_LIB_SRCS}) - -target_link_libraries(kholidays ${KDE4_KIO_LIBS}) - -set_target_properties(kholidays PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) -install(TARGETS kholidays ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/kholidays/DESIGN b/kholidays/DESIGN deleted file mode 100644 index a06f77699..000000000 --- a/kholidays/DESIGN +++ /dev/null @@ -1,280 +0,0 @@ -What: A New libkholiday -Author: Allen Winter -Version: 0.92 2006-04-02 - -This is a draft. Please send constructive comments to the author. -I'm trying hard not to offend anybody. If I make a mistake, particularly -about religious holidays, please let me know about it. --Allen - -I. Introduction - - The current libkholidays code was borrowed from the 'plan' project - many years ago and, has been discussed often on the KDE-PIM mailing list, - we need to replace it with a modern library with a friendly license. - - See http://www.wikipedia.org/Holidays for better, clearer explanations. - -II. Goals - - We hope that the new libkholidays will: - - A. allow KOrganizer to replace the holidays plugin with a KOCore - implementation that links to libkholidays. - - B. allow KOrganizer to support the holidays of many religions (through - plugins if desired) - - C. be part of kdelibs so other applications and components (eg. kdatepicker) - can access holidays. - - D. be licensed so that it can be linked directly to all KDE applications - and can be ported freely to other platforms with binary-only Qt. - -III. Definitions - - Holiday: any day that may have special significance to a fairly large - number of people. A "holy day" can be a holiday, a "day-off" for - all public employees can be a holiday. Also, the remembrance of an - historical event can be a holiday. - - Public Holiday: a day-off from work or school (typically) to commemorate - a historical event, or to honor people. Public holidays are always - bounded to a political region. - - Cultural Holiday : a special day in the culture and therefore usually - bounded to a political region. A day where people "celebrate" - in some fashion. eg. Halloween, St. Valentines, ... - - Religious Holiday: a special day in a religion and not bounded to any - political region. Religions can have holidays that range in - devotion to those were work/school are forbidden, days of - prayer obligation, to historical remembrances, etc. - Governments often have public holidays for some religious holidays. - - Financial Holiday: banks and markets may close on some public holidays. - it would be useful for financial applications to know when. - Financial holidays are tied to public holidays and therefore are - always bounded to a political region. Not sure if financial holidays - move from weekends; eg. if Christmas lands on a weekend is it moved - to a nearby business day? - - Name Day Holiday: (See Bug #92919) In some countries each day is assigned - a first name and persons with that name celebrate that day as their - "Name Day". We will require Name Days to be bounded to a political - region. - - Noteworthy Event: a day of interest. eg. Daylight Savings Time Start/Stop, - Election Day, ... - -IV. Requirements - - * All non-religious date calculations will be performed according to the - Gregorian calendar. To use another calendar, one will need to convert - their date to Gregorian first. - - * Religious holidays will be computed on the appropriate calendar. - i.e. Jewish holidays on the Hebrew calendar. The calling application - can then convert the date to Gregorian, if desired. - - * The political regions will have their own holiday file containing - (possibly through inheritance) the public, cultural, and financial holidays - - * Holidays of political regions will be specified in in files in a - heirarchy similar to how timezones are stored in /usr/share/zoneinfo. - eg. holidays/Canada/, holidays/US/, - holidays/Europe/Germany/, holidays/Australia/, ... - - * Religious holidays will be specified in files separate from the - political region files, by religion name: - eg. holidays/Religious/Jewish, holidays/Religious/Catholic, ... - - * Be able to specify where to move public, day-off holidays if they - land on a weekend. This occurs for holidays with a fixed date. - - * Be able to specify holidays with compound dates; i.e, be able to - combine specifications. For example: "First Monday after May 1" - - * Support lunar phases for the new moon, first quarter moon, - last quarter moon, and full moon. - (One should be able to see moon phases on the calendar as this is - important to some religions -- but this is an application issue) - - * Support june solstice, december solstice, march equinox, and - september equinox -- the so-called "astronomical seasons". - So, in the US for example, one could set a holiday of - summer is on the june solstice. - - * Public holidays that are moved when they land on a weekend will have - their names changed to "Name (Day off)". For example, in the US if - Christmas is on a Sunday, then it will be moved to Monday and have the - name changed to "Christmas (Day off)". Note that if the user has chosen - a Christian set of holidays they will also see "Christmas" on the Sunday. - - * Local governments (states, provinces) will be able to inherit their - holidays from the national government. In general, any holiday set - can inherit holidays from any other holiday set. We expect to use - an "include file" mechanism to support inheritance. - - * Support Holiday categories: - work day-off (public), - school day-off (public), - bank-closed holiday (financial), - noteworthy event (cultural), - religious holiday (religious), - holy day (religous), - name day (cultural), - ... - - * Each Holiday can have any combination of Holiday type. - - * Each Holiday can have its own icon. - - * For the most part, keep religious holidays out of public holidays - and in their own specific holiday files. The exception is when - the governments have religious, public holidays. A religious holiday - that is also a public, work/school day-off should be specified in - government (political) holiday files. - - * Be able to activate more than one region/locale at a time and more - than one religion at a time. - - * Holiday names should be in English so they can be translated with the - usual tools. If a holiday name has no English equivalent then it can - be written in the "native" language. If English is not practical, - then the holiday names can be written in the "native" language and - possibly translated into English later. In other words, we want to - make it easy for people to contribute holiday files so don't exclude - non-English speakers from writing one. - - * The standard KDE tools will be used to translate holiday names. - - * Holiday file format will in XML according to a RELAX NG schema. - There will be tools written to parse and validate our file format - if none are currently available. - - * We will write simple tools to convert existing holiday file formats to - our new format. These tools should provide some easy validation checks. - The new files will be used to bootstrap the new library into KDE. - It might also be useful to write a program to convert iCalendar files into - our format (see http://www.mozilla.org/projects/calendar/holidays.html). - -V. Functionality - - A. The library will provide functions that: - - * Returns a list of all holidays per date. The list will have duplicate - holidays removed (deduped). - - * Returns a list of all holidays for a range of dates, in date order. - The list will have duplicate holidays removed (deduped). - - * Returns a list of all holidays for a Gregorian year, in date order. - The list will have duplicate holidays removed (deduped). - - * "Add" a list of Holidays together. - - * "Dedupe" a list of Holidays. - - * Determine if a date lands on a new moon, first quarter moon, - last quarter moon, or full moon. - - * Determine if a date lands on a solstice or equinox. - - * Determine if a date is a work day-off, school day-off, or bank-closure. - - * Provides holiday names in current language - - * Returns a QStringList of all political regions supported, - (possibly/probably) extracted from the holiday file names. - The region names will need to be translated into all languages. - - * Returns a QStringList of all religions supported, - (possibly/probably) extracted from the holiday file names. - The religion names will need to be translated into all languages. - - * - - B. A KGetNewStuff mechanism will be implemented so that holiday files - can be donated to the project and installed by using this common - PIM mechanism. - - - C. Provide a GUI to create, edit, and translate the holiday files. - -VI. Date Specification - - The holiday date can have one of the following specifications: - - * Fixed date: the date is fixed on the calendar. - - * Postional date: the date occurs according to a position, - eg. "first Monday in September". - - * Moon date: the date corresponds to a phase of the moon. - - * Solstice date: the date corresponds to the June or December solstice. - - * Equinox date: the date corresponds to the March or September equinox. - - * Christmas: the holiday occurs on Christmas. - - * Easter: the holiday occurs on Easter. - - In addition, the date can have a "before weekend" or "after weekend" - modifier, meaning that if the holiday date lands on a weekend, the date - is moved to the first workday/schoolday before or after the weekend. - -APPENDIX A. Classifying Holidays (Sample) - - This list of holidays was extracted from the US Holidays - at http://www.mozilla.org/projects/calendar/holidays.html - - New Year's Day: public, work day-off, school day-off, bank-closed, move from weekend - Groundhog Day: noteworthy event. no day-offs - Lincoln's birthday: noteworthy event, no day-offs - Washington's birthday: noteworthy event, no day-offs - Valentine's Day: cultural, no day-offs - Palm Sunday: religious, no day-offs - Good Friday: religious, no day-offs - Easter (Western): religious, no day-offs - Easter (Orthodox): religious, no day-offs - Tax Day: noteworthy event, no day-offs - April Fool's Day: cultural, no day-offs - St. Patrick's Day: cultural, no day-offs (perhaps religious, I don't know) - Flag Day: noteworthy event, no day-offs - Independence Day: public, work day-off, school day-off, bank-closed, move from weekend - Columbus Day: public, work day-off, school day-off, bank-closed - Halloween: cultural, no day-offs - Veteran's Day: public, work day-off, school day-off, bank-closed, move from weekend - Christmas: public, work day-off, school day-off, bank-closed, move from weekend - Martin Luther King's Birthday: public, work day-off, school day-off, bank-closed - President's Day: public, work day-off, school day-off, bank-closed - Daylight Savings Time begins: noteworthy event - ASH Wednesday: religious, no days-off - Memorial Day: public, work day-off, school day-off, bank-closed - Mother's Day: cultural, no days-off - Father's Day: cultural, no days-off - Labor Day: public, work day-off, school day-off, bank-closed - Daylight Savings Time ends: noteworthy event - Election Day: noteworthy event, school day-off - Thanksgiving: public, work day-off, school day-off, bank-closed - - - ------end here----- - -Religions: Catholic, Greek Orthodox, Jewish, Islam, Protestants,... - -Other special dates of interest: - + start/end daylight savings time - + election day - + - -See Reinhold's XML DTD (holiday.dtd) -[Reinhold: I didn't check the DTD at all, so it might be completely wrong - or breaks with all XML specs or whatever. Basically, currently it's meant - only to develop a nice structure of the files, not for real use in code yet.] - -A good starting point [..for parsing Reinhold's XML..] would be to use some code -from the kconfig_compiler in kdelibs/kdecore/kconfig_compiler, which parses -the XML file. diff --git a/kholidays/Mainpage.dox b/kholidays/Mainpage.dox deleted file mode 100644 index e69de29bb..000000000 diff --git a/kholidays/Messages.sh b/kholidays/Messages.sh deleted file mode 100644 index 3a20b1e9f..000000000 --- a/kholidays/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -$XGETTEXT *.cpp -o $podir/libkholidays.pot diff --git a/kholidays/astroseasons.cpp b/kholidays/astroseasons.cpp deleted file mode 100644 index 82f83ba05..000000000 --- a/kholidays/astroseasons.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2006-2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "astroseasons.h" -#include - -using namespace LibKHolidays; - -AstroSeasons::AstroSeasons() -{ -} - -AstroSeasons::~AstroSeasons() -{ -} - -QString AstroSeasons::seasonStr( const QDate &date ) const -{ - return seasonName( season( date ) ); -} - -QString AstroSeasons::seasonName( AstroSeasons::Season season ) -{ - switch ( season ) { - case JuneSolstice: - return i18n( "June Solstice" ); - case DecemberSolstice: - return i18n( "December Solstice" ); - case MarchEquinox: - return i18n( "March Equinox" ); - case SeptemberEquinox: - return i18n( "September Equinox" ); - default: - case None: - return QString(); - } -} - -AstroSeasons::Season AstroSeasons::season( const QDate &date ) const -{ -// see http://www.hermetic.ch/cal_sw/ve/ve.php - Season retSeason = None; - - int year = date.year(); - //Use dumb method for now - if ( date == QDate( year, 6, 22 ) ) { - return JuneSolstice; - } - if ( date == QDate( year, 12, 22 ) ) { - return DecemberSolstice; - } - if ( date == QDate( year, 3, 22 ) ) { - return MarchEquinox; - } - if ( date == QDate( year, 9, 22 ) ) { - return SeptemberEquinox; - } - - return retSeason; -} diff --git a/kholidays/astroseasons.h b/kholidays/astroseasons.h deleted file mode 100644 index 427a0518b..000000000 --- a/kholidays/astroseasons.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2006-2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KHOLIDAYS_ASTROSEASONS_H -#define KHOLIDAYS_ASTROSEASONS_H - -/** - Represents and manages the Astronomical Seasons (solstices and equinoxes). - For the purposes of this class, we sometimes use the shorthand of "Season" - where we really mean "Astronomical Season". - - An Astronomical Season can be one of the following: - - - June solstice - - December solstice - - March equinox - - September equinox - - A very good description of the astronomical seasons can be read at the - Wikipedia, - http://en.wikipedia.org/wiki/Seasons - - Note that this class represents the "Astronomical Seasons" and not - the traditional "Seasons" which vary widely by culture. -*/ - -#include -#include - -#include "kholidays_export.h" - -namespace LibKHolidays { - -class KHOLIDAYS_EXPORT AstroSeasons -{ - public: - enum Season { - JuneSolstice, - DecemberSolstice, - MarchEquinox, - SeptemberEquinox, - None - }; - - AstroSeasons(); - ~AstroSeasons(); - - /** - Return the season for the specified Gregorian date. - The enum 'None' is returned if one of the supported seasons - does not occur on the date. - - @param date compute the season for the specified Gregorian date. - */ - Season season( const QDate &date ) const; - - /** - Return the season as a text string for the specified date. - A null string is returned if one of the supported seasons does - not occur on the date. - - @param date compute the season for the specified Gregorian date. - */ - QString seasonStr( const QDate &date ) const; - - /** - Return the string representation of season. - - @param season astronomical season. - */ - static QString seasonName( Season season ); - - private: - /** - Return the approximate time of a solstice or equinox event. - The year must be in the range -1000...3000. Within that range the - the error from the precise instant is at most 2.16 minutes. - - @param year year. - @param Season astronomical season. - - @return the Julian Day of the event in dynamical time. - */ - double approxEquinox( int year, Season season ); -}; - -} - -#endif - diff --git a/kholidays/config-libkholidays.h.cmake b/kholidays/config-libkholidays.h.cmake deleted file mode 100644 index bc8022c4b..000000000 --- a/kholidays/config-libkholidays.h.cmake +++ /dev/null @@ -1,8 +0,0 @@ -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_ERR_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MALLOC_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_CDEFS_H 1 diff --git a/kholidays/holidays/CMakeLists.txt b/kholidays/holidays/CMakeLists.txt deleted file mode 100644 index 764cbf516..000000000 --- a/kholidays/holidays/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ - -install( FILES - holiday_ar - holiday_at - holiday_au - holiday_bavarian - holiday_BelgiumDutch - holiday_BelgiumFrench - holiday_BelgiumWalloon - holiday_br - holiday_ca - holiday_catalan - holiday_cl - holiday_co - holiday_ch - holiday_cz - holiday_de - holiday_dk - holiday_ee - holiday_es - holiday_fi - holiday_fr - holiday_frswiss - holiday_gb - holiday_gr - holiday_gt - holiday_hu - holiday_is - holiday_il - holiday_it - holiday_jm - holiday_jp - holiday_lt - holiday_mx - holiday_nl - holiday_no - holiday_nz - holiday_pl - holiday_pt - holiday_py - holiday_quebec - holiday_ro - holiday_ru - holiday_se - holiday_si - holiday_th - holiday_ua - holiday_us - holiday_uy - holiday_ie - holiday_Suedtirol - holiday_za - DESTINATION ${DATA_INSTALL_DIR}/libkholidays) - - diff --git a/kholidays/holidays/holiday_BelgiumDutch b/kholidays/holidays/holiday_BelgiumDutch deleted file mode 100644 index 9b663a435..000000000 --- a/kholidays/holidays/holiday_BelgiumDutch +++ /dev/null @@ -1,34 +0,0 @@ -: -: Belgian (in Dutch) holiday file. Copy to ~/.holiday -: -: Author: Guido van Rossum, CWI, Amsterdam -: Adapted from Dutch holiday by Danny Backx and Jean Cayron -: -small "Nieuwjaar" weekend on 1.1. -small "Driekoningen" on 6.1 -small "Lichtmis" on 2.2 -small "Vastenavond" on easter minus 47 days -small "Aswoensdag" on easter minus 46 days -small "Palmzondag" on easter minus 7 days -small "Witte Donderdag" on easter minus 3 days -small "Goede Vrijdag" on easter minus 2 days -small "Pasen - Feestdag" weekend on easter -small "Paasmaandag" weekend on easter plus 1 day -small "Feest van de Arbeid" weekend on 1.5 -small "Hemelvaart" weekend on easter plus 39 days -small "Moederdag" on every second sunday in may -small "Pinksteren" weekend on easter plus 49 days length 2 days -small "Vaderdag" on every third sunday in june -small "Vlaamse Gemeenschap feestdag" on 11.7 -small "Nationale feestdag" weekend on 21.7 -small "OLV Hemelvaart" weekend on 15.8 -small "Franse Gemeenschap feestdag" on 27.9 -small "Waalse feesten" on every third sunday in september -small "Allerheiligen" weekend on 1.11 -small "Allerzielen" on 2.11 -small "Wapenstilstand" weekend on 11.11 -smaal "Duitstalige Gemeenschap feestdag" on 15.11 -small "Sinterklaas" on 06.12 -small "Kerstmis" weekend on 25.12. -small "Tweede kerstdag" on 26.12. -small "Oudjaar" on 31.12 diff --git a/kholidays/holidays/holiday_BelgiumFrench b/kholidays/holidays/holiday_BelgiumFrench deleted file mode 100644 index 918d9f6c4..000000000 --- a/kholidays/holidays/holiday_BelgiumFrench +++ /dev/null @@ -1,34 +0,0 @@ -: -: Belgian (in french) holiday file. Copy to ~/.holiday -: -: Author: Guido van Rossum, CWI, Amsterdam -: Adapted from Dutch holiday by Danny Backx and Jean Cayron -: -small "Jour de l'an" weekend on 1.1. -small "Épiphanie" on 6.1 -small "Chandeleur" on 2.2 -small "Mardi-gras" on easter minus 47 days -small "Mercredi des cendres" on easter minus 46 days -small "Dimanche des rameaux" on easter minus 7 days -small "Jeudi saint" on easter minus 3 days -small "Vendredi saint" on easter minus 2 days -small "Pâques" weekend on easter -small "Lundi de Pâques" weekend on easter plus 1 day -small "Fête du travail" weekend on 1.5 -small "Ascencion" weekend on easter plus 39 days -small "Fête des mères" on every second sunday in may -small "Pentecôte" weekend on easter plus 49 days -small "Lundi de Pentecôte" weekend on easter plus 50 days -small "Fête des pères" on every third sunday in june -small "Fête de la Communauté flamande" on 11.7 -small "Fête nationale - Férié" weekend on 21.7 -small "Assomption" weekend on 15.8 -small "Fête de la Communauté française de Belgique" on 27.9 -small "Fêtes de Wallonie" on every third sunday in september -small "Toussaint" weekend on 1.11 -small "Jour des morts" on 2.11 -small "Armistice" weekend on 11.11 -smaal "Fête de la Communauté germanophone de Belgique" on 15.11 -small "Saint Nicolas" on 06.12 -small "Noël" weekend on 25.12. -small "Saint-Sylvestre" on 31.12 diff --git a/kholidays/holidays/holiday_BelgiumWalloon b/kholidays/holidays/holiday_BelgiumWalloon deleted file mode 100644 index aace37dc0..000000000 --- a/kholidays/holidays/holiday_BelgiumWalloon +++ /dev/null @@ -1,34 +0,0 @@ -: -: Belgian (in walloon) holiday file. Copy to ~/.holiday -: -: Author: Guido van Rossum, CWI, Amsterdam -: Adapted from Dutch holiday by Danny Backx and Djan Cayron -: -small "Novelan" weekend on 1.1. -small "Fiesse des Rwès" on 6.1 -small "Tchandleuse" on 2.2 -small "Crås mårdi" on easter minus 47 days -small "Mierkidi des cindes" on easter minus 46 days -small "Floreye Påke" on easter minus 7 days -small "Djudi sint" on easter minus 3 days -small "Bon vénrdi" on easter minus 2 days -small "Påke" weekend on easter -small "Londi d' Påke" weekend on easter plus 1 day -small "Fiesse do boutaedje" weekend on 1.5 -small "Assincion" weekend on easter plus 39 days -small "Fiesse des méres" on every second sunday in may -small "Céncweme (Pintcosse)" weekend on easter plus 49 days -small "Londi d' Céncweme" weekend on easter plus 50 days -small "Fiesse des péres" on every third sunday in june -small "Fiesse del Cominålté flaminde" on 11.7 -small "Fiesse nacionåle" weekend on 21.7 -small "Grande Notru Dame" weekend on 15.8 -small "Fiesse del Cominålté francesse di Beldjike" on 27.9 -small "Fiesses di Walonreye" on every third sunday in september -small "Tossint" weekend on 1.11 -small "Djoû des åmes" on 2.11 -small "Årmistice" weekend on 11.11 -smaal "Fiesse del Cominålté Tîxhon-cåzante di Belgjike" on 15.11 -small "Sint Nicolai" on 06.12 -small "Noyé" weekend on 25.12. -small "Sint Silvesse" on 31.12 diff --git a/kholidays/holidays/holiday_Suedtirol b/kholidays/holidays/holiday_Suedtirol deleted file mode 100644 index 3838dbea5..000000000 --- a/kholidays/holidays/holiday_Suedtirol +++ /dev/null @@ -1,32 +0,0 @@ -: -: Südtirol holiday file. -: by Roland Reiterer (roland_reiterer2001@gmx.net) -: -"Neujahr" weekend on 1.1 -"Hl. 3 Könige" weekend on 6.1 -small "Tag der Frau" on 8.3 -small "Hl. Joseph" on 19.3 -small "Vatertag" on 19.3 -small "Unnsinger Donnerstag" on easter minus 52 days -small "Faschingsdienstag" on easter minus 47 days -small "Aschermittwoch" on easter minus 46 days -"Ostersonntag" weekend on easter -"Ostermontag" weekend on easter plus 1 day -small "Pfingstsonntag" on easter plus 49 days -small "Pfingstmontag" on easter plus 50 days -small "Christi Himmelfahrt" on easter plus 39 days -"Tag der Freiheit" weekend on 25.4 -"Tag der Arbeit" weekend on 1.5 -small "Muttertag" on second sunday in may -small "Tag der Republik" on 2.6 -small "Hl. Peter und Paul" on 29.6 -"Maria Himmelfahrt" weekend on 15.8 -small "Ferragosto" on 15.8 -small "Hl. Franziskus" on 4.10 -"Allerheiligen" weekend on 1.11 -small "Allerseelen" on 2.11 -small "Nationalfeiertag" on 4.11 -"Maria Empfängnis" weekend on 8.12 -"Christtag" weekend on 25.12 -"Stephanstag" weekend on 26.12 -small "Silvester" on 31.12 diff --git a/kholidays/holidays/holiday_ar b/kholidays/holidays/holiday_ar deleted file mode 100644 index 95c4185bc..000000000 --- a/kholidays/holidays/holiday_ar +++ /dev/null @@ -1,58 +0,0 @@ -: -: Argentina holiday file -: -: Official Holiday List -: See http://www.mininterior.gov.ar/servicios/feriados.asp -: -: Related national laws -: http://www.uncu.edu.ar/contenido/skins/unc/download/Ley%2023555.pdf -: http://www.uncu.edu.ar/contenido/skins/unc/download/Ley%2024445.pdf -: http://www.puntoprofesional.com/P/0650/LEY_26416.HTM -: -: Author: Daniel Vega - - -: National holidays - -small "Año Nuevo" weekend on 1/1 -small "Día Nacional de la Memoria" weekend on 3/24 -small "Viernes Santo" weekend on easter minus 2 -small "Día de los Caídos en Malvinas" weekend on 4/2 -small "Día del Trabajador" weekend on 5/1 -small "Primer Gobierno Patrio" weekend on 5/25 -small "Día de Manuel Belgrano" weekend on third monday in june -small "Día de la Independencia" weekend on 7/9 -small "Día de San Martín" weekend on third monday in august -small "Día de la Raza" weekend on (([10/12] == [tuesday after ([10/11])] || [10/12] == [wednesday after ([10/11])]) ? [monday before ([10/12])] : - [monday after ([10/11])]) -small "Inmaculada Concepción de María" weekend on 12/8 -small "Navidad" weekend on 12/25 - -: Non-workable days -small "Jueves Santo" on easter minus 3 - -: Jewish and Islamic holidays not easy to calculate - -: Interesting dates - -small "Día de Reyes" on 1/6 -small "Día de San Valentín" on 2/14 -small "Día de la Mujer" on 3/8 -small "Sábado de Gloria" on easter minus 1 -small "Domingo de Pascua" on easter -small "Día del Animal" on 4/29 -small "Día del Ahijado/Nieto" on second sunday in may -small "Día del Padre" on third sunday in june -small "Día del Amigo" on 7/20 -small "Dia del Niño" on second sunday in august -small "Día de la Madre" on third sunday in october -small "Halloween" on 10/31 -small "Noche Buena" on 12/24 -small "Día de los Inocentes" on 12/28 -small "Fin de Año" on 12/31 - -: Seasons -"Equinoxio de otoño" on 3/21 -"Solsticio de invierno" on 6/21 -"Equinoxio de primavera" on 9/21 -"Solsticio de verano" on 12/21 diff --git a/kholidays/holidays/holiday_at b/kholidays/holidays/holiday_at deleted file mode 100644 index b84c10699..000000000 --- a/kholidays/holidays/holiday_at +++ /dev/null @@ -1,48 +0,0 @@ -: -: Austrian holiday file. -: Author: Friedrich Leisch -: -small "Neujahr" weekend on 1.1. -small "Hl. 3 Könige" weekend on 6.1. - -blue "Sommerzeit" on last sunday in march - -small "Rosenmontag" on easter minus 48 days -small "Faschingsdienstag" on easter minus 47 days -small "Aschermittwoch" on easter minus 46 days -small "Palmsonntag" on easter minus 7 days -small "Gründonnerstag" on easter minus 3 days -small "Karfreitag" on easter minus 2 days -small "Karsamstag" on easter minus 1 days -small "Ostern" weekend on easter length 2 days -small "Pfingsten" weekend on easter plus 49 days length 2 days -small "Christi Himmelfahrt" weekend on easter plus 39 days -small "Fronleichnam" weekend on easter plus 60 days - -small "Tag der Arbeit" weekend on 1.5. -small "Muttertag" on second sunday in may -small "Vatertag" on second sunday in june - -small "Maria Himmelfahrt" weekend on 15.8. - -blue "Winterzeit" on last sunday in october - -small "Nationalfeiertag" weekend on 26.10. - -small "Allerheiligen" weekend on 1.11. -small "Allerseelen" on 2.11. - -small "Martini" on 11.11. -small "Leopoldi" on 15.11. -small "Krampus" on 5.12. -small "Nikolaus" on 6.12. -small "Maria Empfängnis" weekend on 8.12. -small "1. Advent" on sunday before 24.12. minus 21 days -small "2. Advent" on sunday before 24.12. minus 14 days -small "3. Advent" on sunday before 24.12. minus 7 days -small "4. Advent" on sunday before 24.12. -small "Hl. Abend" on 24.12. -small "Christtag" weekend on 25.12. -small "Stephani" weekend on 26.12. - -small "Silvester" on 31.12. diff --git a/kholidays/holidays/holiday_au b/kholidays/holidays/holiday_au deleted file mode 100644 index 052aa702e..000000000 --- a/kholidays/holidays/holiday_au +++ /dev/null @@ -1,69 +0,0 @@ -: -: Australian holiday file. Copy to ~/.holiday -: -: Author: Peter Turnbull (peter@cbr.atr.com.au) -: -: Note that some standard holidays vary widely depending on which state you -: are in. It is recommended that you either remove the weekend keyword from -: the states that aren't applicable to you, or just remove them. -: -: TODO: correct the holidays as noted below. I'm not sure how to do that. - -: If Christmas or Boxing Day fall on a weekend then the holidays are -: moved to the following Monday and Tuesday. - -small "Christmas" weekend on december 25 -small "Boxing Day" weekend on december 26 - -: If new years day falls on a weekend then the Monday is a holiday. -small "New Year's Day" weekend on january 1 - -small "Australia Day" on january 26 - -small "Anzac Day" on april 25 -small "Easter Sunday" weekend on easter -small "Good Friday" weekend on easter minus 2 -small "Easter Monday" weekend on easter plus 1 - -: About the 2nd weekend in June. The holiday is always a Monday. -small "Queen's Birthday" weekend on second monday in june -small "Melbourne Cup" weekend on first tuesday in november - -: Labour day for ACT, NSW, SA -small "Labour Day" weekend on first monday in october - -: Specific holidays for the ACT -small "Canberra Day" weekend on march 21 -small "ACT - Bank holiday" weekend on first monday in august - -: Specific holidays for Victoria -small "VIC - Labour Day" weekend on second monday in march - -: Show day is always a Thursday. I think the last in Spetember but not sure. -small "Melbourne Show Day" weekend on september 22 - -: Specific holidays for SA -small "Adelaide Cup Day" weekend on may 16 -small "SA - Proclamation Day" weekend on december 28 - -: Specific holidays for Tasmania -small "TAS - Eight Hours Day" weekend on march 7 -small "TAS - Bank Holiday" weekend on april 5 -small "TAS - Recreation Day" weekend on november 7 - -: Specific holidays for WA -small "WA - Labour Day" weekend on first monday in march -small "WA - Foundation Day" weekend on first monday in june -small "WA - Queen's Birthday" weekend on september 26 - -: Specific holidays for NT -small "NT - May Day" weekend on first monday in may -small "Alice Springs Show Day" weekend on first friday in july -small "Tennant Creek Show Day" weekend on second friday in july -small "Katherine Show Day" weekend on third friday in july -small "Darwin Show Day" weekend on last friday in july -small "NT - Picnic Day" weekend on first monday in august - -: Specific holidays for QLD -small "QLD - Labour Day" weekend on first monday in may - diff --git a/kholidays/holidays/holiday_bavarian b/kholidays/holidays/holiday_bavarian deleted file mode 100644 index dffc08f97..000000000 --- a/kholidays/holidays/holiday_bavarian +++ /dev/null @@ -1,93 +0,0 @@ -: -: Slightly bavarianized german holiday file. -: by Burkhard Ludwig -: - -: Rearranged and bavaricized version of holiday_german: - -: -: Hints (to be understood by germans): -: -: Schwalben... -: An OCULI da kommen sie -: An MARIÄ GEBURT, da sind sie wieder furt. -: Geranien... -: pflanzt man auf dem Balkon nach den Eisheiligen (PANKRAZ bis kalte SOPHIE) -: Gänse... -: Wer einen guten Braten macht hat auch ein gutes Herz. (MARTINI) -: Spargel... -: wird bis höchstens JOHANNI gestochen. -: Regen... -: Wenns ans SIEBENSCHLÄFER regnet, so regnet's sieben Wochen. -: - -: -: 2) Holidays which are known by the usual pagan too. -: (Since its vacation or sentimental or the like) -: - -small "Neujahr" weekend on 1.1. -small "Hl. 3 Könige" weekend on 6.1. -small "Rosenmontag" on easter minus 48 days -small "Fasching" on easter minus 47 days -small "Aschermittwoch" on easter minus 46 days -small "Karfreitag" weekend on easter minus 2 days -small "Ostern" weekend on easter length 2 days -small "Pfingsten" weekend on easter plus 49 days length 2 days -small "Christi Himmelfahrt" weekend on easter plus 39 days -small "Mariä Himmelfahrt" weekend on 15.8 -small "Fronleichnam" weekend on easter plus 60 days -small "1. Mai" weekend on 1.5. -small "Einheitstag" weekend on 3.10. -small "Allerheiligen" weekend on 1.11. -small "Buß- und Bettag" weekend on sunday before 24.12. minus 32 days -small "Hl. Abend" on 24.12. -small "Weihnachten" weekend on 25.12. length 2 days -small "Silvester" on 31.12. - -: -: 3) Devil's Grandmothers Days -: - blue "Sommerzeit" on last sunday in march - blue "Winterzeit" on last sunday in october -: -: 4) Ecclestiastica -: - -small black "1. Advent" on sunday before 24.12. minus 21 days -small black "2. Advent" on sunday before 24.12. minus 14 days -small black "3. Advent" on sunday before 24.12. minus 7 days -small black "4. Advent" on sunday before 24.12. -small black "1. Fastensonntag" on easter minus 42 days -small black "2. Fastensonntag" on easter minus 35 days -small black "3. Fastensonntag" on easter minus 28 days - blue "Oculi" on easter minus 28 days -small black "4. Fastensonntag" on easter minus 21 days -small black "5. Fastensonntag" on easter minus 14 days -small black "Palmsonntag" on easter minus 7 days -small black "Christkönig" on sunday before 23.12. minus 28 days - -: -: 5) Selected saints -: - -small black "Lichtmeß" on 2.2. -small black "Pankraz" on 11.5. -small black "Servaz" on 12.5. -small black "Bonifaz" on 13.5. -small black "Sophie" on 14.5. -small black "Johanni" on 24.6. -small black "Siebenschläfer" on 27.6. -small black "Mariä Geburt" on 8.9. -small black "Martini" on 11.11. -small black "Nikolaus" on 6.12. - -: -: 6) Commercials --- beware -: - -small black "Muttertag" on second sunday in may -small black "1. Wies'nsonntag" on first sunday in october minus 14 days -small green "Karwoche" on easter minus 6days length 6 days - - diff --git a/kholidays/holidays/holiday_br b/kholidays/holidays/holiday_br deleted file mode 100644 index 09bb15dcc..000000000 --- a/kholidays/holidays/holiday_br +++ /dev/null @@ -1,238 +0,0 @@ -: -: Brazilian holiday file. -: -: Author: Juliano Ferraz Ravasi -: Version: 1 - 1 Oct 2006 -: -: Released under the General Public License -: - -: Feriados nacionais (Fedaral holidays) -::: - -small weekend "Confraternização Universal" on january 1 -small weekend "Tiradentes" on april 21 -small weekend "Dia do Trabalho" on may 1 -small weekend "Independência do Brasil" on september 7 -small weekend "Proclamação da República" on november 15 - -: Feriados e datas comemorativas religiosos (Religious holidays) -::: - -small "Reis Magos" on january 6 -small weekend "Carnaval" on easter minus 48 days -small weekend "Carnaval" on easter minus 47 days -small "Cinzas" on easter minus 46 days -small "Paixão de Cristo" on easter minus 2 days -small weekend "Páscoa" on easter -small weekend "Corpus Christi" on easter plus 60 days -small weekend "Nossa Senhora Aparecida" on october 12 -small "Todos os Santos" on november 1 -small weekend "Finados" on november 2 -small weekend "Natal" on december 25 - -: Estações do ano (Seasons) -::: - -small green "Início do Outono" on march 22 -small green "Início do Inverno" on june 22 -small green "Início da Primavera" on september 22 -small green "Início do Verão" on december 22 - -: Datas comemorativas mundiais (International commemmorative dates) -::: - -:small "Dia Mundial da Religião" on january 21 -small "Dia Internacional da Mulher" on march 8 -:small "Dia Mundial do Consumidor" on march 15 -:small "Dia Internacional Contra a Discriminação Racial" on march 21 -:small "Dia Mundial da Água" on march 22 -:small "Dia Internacional do Livro Infantil" on april 2 -small "Dia Mundial da Saúde" on april 7 -small "Dia Mundial de Combate ao Câncer" on april 8 -:small "Dia Internacional do Café" on april 14 -:small "Dia Mundial do Desenhista" on april 15 -:small "Dia Mundial do Escoteiro" on april 23 -:small "Dia Internacional da Cruz Vermelha" on may 8 -:small "Dia Mundial do Enfermeiro" on may 12 -:small "Dia Internacional das Telecomunicações" on may 17 -:small "Dia Mundial dos Museus" on may 18 -:small "Dia Internacional das Crianças Vítimas de Agressão" on june 4 -:small "Dia Mundial do Meio Ambiente" on june 5 -small "Dia Internacional do Combate às Drogas" on june 26 -:small "Dia Mundial da População" on july 11 -:small "Dia Mundial da Alfabetização" on september 8 -:small "Dia Internacional para Preservação da Camada de Ozônio" on september 16 -:small "Dia Mundial da Alimentação" on october 16 -small "Dia das Bruxas" on october 31 -small "Dia Mundial de Ação de Graças" on november 28 -small "Dia Mundial da Luta contra a AIDS" on december 1 -:small "Dia Internacional das Pessoas Portadoras de Deficiência" on december 3 -:small "Dia Internacional do Voluntário" on december 5 -:small "Dia da Declaração dos Direitos do Homem" on december 10 -small "Reveillon" on december 31 - -: Outras datas comemorativas (Other commemorative dates) -::: - -:small "Dia da Criação da 1ª Tipografia" on january 4 -:small "Dia do Fotógrafo" on january 6 -:small "Dia da Gratidão" on january 6 -:small "Dia da Liberdade de Culto" on january 7 -:small "Dia do Fico" on january 9 -:small "Dia do Farmacêutico" on january 20 -:small "Dia do Fusca" on january 20 -:small "Dia da Previdência Social" on january 24 -:small "Dia do Carteiro" on january 25 -:small "Dia da Saudade" on january 30 -:small "Dia do Publicitário" on february 1 -:small "Dia do Gráfico" on february 7 -:small "Dia do Repórter" on february 16 -:small "Dia do Esportista" on february 19 -:small "Dia do Turismo" on march 2 -:small "Dia do Filatelista Brasileiro" on march 5 -:small "Dia do Fuzileiro Naval" on march 7 -:small "Dia do Telefone" on march 10 -:small "Dia do Bibliotecário" on march 12 -:small "Dia da Poesia" on march 14 -:small "Dia da Escola" on march 15 -:small "Dia do Meteorologista" on march 23 -:small "Dia do Circo" on march 27 -:small "Dia do Teatro" on march 27 -:small "Dia do Revisor e do Diagramador" on march 28 -:small "Dia da Mentira" on april 1 -:small "Dia do Jornalismo" on april 7 -:small "Dia da Natação" on april 8 -:small "Dia dos Jovens" on april 13 -:small "Dia da Conservação do Solo" on april 15 -:small "Dia do Índio" on april 19 -:small "Dia do Diplomata" on april 20 -:small "Dia do Metalúrgico" on april 21 -:small "Dia do Planeta Terra" on april 22 -:small "Dia da Força Aérea Brasileira" on april 22 -:small "Dia do Contabilista" on april 25 -:small "Dia da Empregada Doméstica" on april 27 -:small "Dia da Educação" on april 28 -:small "Dia do Ferroviário" on april 30 -:small "Dia do Cartógrafo" on may 6 -:small "Dia do Artista Plástico" on may 8 -:small "Dia do Automóvel" on may 13 -:small "Dia do Assistente Social" on may 15 -:small "Dia do Gari" on may 16 -:small "Dia da Língua Nacional" on may 21 -:small "Dia do Apicultor" on may 22 -:small "Dia do Vestibulando" on may 24 -:small "Dia da Indústria" on may 25 -:small "Dia do Profissional Liberal" on may 27 -:small "Dia do Estatístico" on may 29 -:small "Dia do Geógrafo" on may 29 -:small "Dia do Geólogo" on may 30 -:small "Dia da Imprensa" on june 1 -:small "Dia do Porteiro" on june 9 -:small "Dia da Língua Portuguesa" on june 10 -:small "Dia da Marinha Brasileira" on june 11 -small "Dia dos Namorados" on june 12 -:small "Dia do Paleontólogo" on june 15 -:small "Dia do Químico" on june 18 -:small "Dia do Migrante" on june 19 -:small "Dia da Música" on june 21 -:small "Dia do Aeroviário" on june 22 -:small "Dia do Imigrante" on june 25 -:small "Dia do Metrologista" on june 26 -:small "Dia da Telefonista" on june 29 -:small "Dia do Pescador" on june 29 -:small "Dia da Vacina BCG" on july 1 -:small "Dia do Bombeiro" on july 2 -:small "Dia do Engenheiro Florestal" on july 12 -:small "Dia de Proteção às Florestas" on july 17 -:small "Dia do Futebol" on july 19 -:small "Dia da Amizade" on july 20 -:small "Dia do Escritor" on july 25 -:small "Dia do Agricultor" on july 28 -:small "Dia do Advogado" on august 11 -:small "Dia da Televisão" on august 11 -:small "Dia do Economista" on august 13 -:small "Dia da Informática" on august 15 -:small "Dia da Habitação" on august 21 -:small "Dia do Folclore" on august 22 -:small "Dia do Soldado" on august 25 -:small "Dia do Psicólogo" on august 27 -:small "Dia do Nutricionista" on august 31 -:small "Dia do Biólogo" on september 3 -:small "Dia da Independência" on september 7 -:small "Dia do Administrador" on september 9 -:small "Dia do Médico Veterinário" on september 9 -:small "Dia dos Símbolos Nacionais" on september 18 -:small "Dia do Idoso" on september 21 -:small "Dia da Árvore" on september 21 -:small "Dia do Rádio" on september 25 -:small "Dia do Trânsito" on september 25 -:small "Dia da Secretária" on september 30 -:small "Dia dos Animais" on october 4 -:small "Dia da Promulgação da Atual Constituição Brasileira" on october 5 -:small "Dia da Pessoa Portadora de Deficiência Física" on october 11 -small "Dia da Criança" on october 12 -:small "Dia do Agrônomo" on october 12 -:small "Dia do Fisioterapeuta" on october 13 -:small "Dia da Pecuária" on october 14 -:small "Dia do Professor" on october 15 -:small "Dia do Médico" on october 18 -:small "Dia do Aviador" on october 23 -:small "Dia da ONU" on october 24 -:small "Dia da Democracia" on october 25 -:small "Dia do Dentista" on october 25 -:small "Dia do Funcionário Público" on october 28 -:small "Dia do Livro" on october 29 -:small "Dia do Comércio" on october 30 -:small "Dia do Cinema Brasileiro" on november 5 -:small "Dia da Bandeira" on november 19 -:small "Dia da Consciência Negra" on november 20 -:small "Dia do Teólogo" on november 30 -:small "Dia da Reforma Agrária" on november 30 -:small "Dia da Astronomia" on december 2 -:small "Dia do Orientador Educacional" on december 4 -:small "Dia da Família" on december 8 -:small "Dia do Fonoaudiólogo" on december 9 -:small "Dia do Engenheiro" on december 11 -:small "Dia do Arquiteto" on december 11 - -: Datas históricas -::: - -small "Abertura dos Portos no Brasil, 1808" on january 28 -small "Descobrimento do Brasil, 1500" on april 22 -small "Abolição da Escravatura, 1888" on may 13 -small "Golpe Militar, 1964" on march 31 -small "Chegada do Homem à Lua, 1969" on june 20 -small "Descobrimento da América, 1492" on october 12 - -: Datas comemorativas de estados e cidades -::: - -:small "Aniversário de Belém" on january 12 -:small "Aniversário da Cidade de São Paulo" on january 25 -:small "Aniversário de Macapá" on february 4 -:small "Aniversário da Cidade do Rio de Janeiro" on march 1 -:small "Aniversário de Recife" on march 12 -:small "Aniversário de Aracaju" on march 17 -:small "Aniversário de Florianópolis" on march 23 -:small "Aniversário de Porto Alegre" on march 26 -:small "Aniversário de Curitiba" on march 29 -:small "Aniversário de Cuiabá" on april 8 -:small "Aniversário de Fortaleza" on april 12 -:small "Aniversário de Brasília" on april 21 -:small "Aniversário de Palmas" on may 20 -:small "Aniversário de Boa Vista" on june 9 -:small "Aniversário de Teresina" on august 16 -:small "Aniversário de Campo Grande" on august 26 -:small "Aniversário de Vitória" on september 8 -:small "Aniversário de São Luís" on september 8 -:small "Aniversário de Maceió" on december 5 -:small "Aniversário de Belo Horizonte" on december 12 -:small "Aniversário de Rio Branco" on december 28 - -: Datas comerciais -::: - -small "Dia das Mães" on second sunday in may -small "Dia dos Pais" on second sunday in august diff --git a/kholidays/holidays/holiday_ca b/kholidays/holidays/holiday_ca deleted file mode 100644 index 55832b4f3..000000000 --- a/kholidays/holidays/holiday_ca +++ /dev/null @@ -1,21 +0,0 @@ -: -: Canadian holiday file. Copy to ~/.holiday -: -: Author: Peter Littlefield -: -small "New Year's Day" weekend on january 1 -small "Valentine's Day" on february 14 -small "Good Friday" weekend on easter minus 2 days -small "Easter" weekend on easter -small "Easter Monday" weekend on easter plus 1 day -small "Mother's Day" on second sunday in may -small "Victoria Day" weekend on monday before may 24 -small "Father's Day" on third sunday in june -small "St-Jean Baptiste" on june 24 -small "Canada Day" weekend on july 1 -small "Civic Holiday" weekend on first monday in august -small "Labour Day" weekend on first monday in september -small "Thanksgiving" weekend on second monday in october -small "Remembrance Day" weekend on november 11 -small "Christmas" weekend on december 25 -small "Boxing Day" weekend on december 26 diff --git a/kholidays/holidays/holiday_catalan b/kholidays/holidays/holiday_catalan deleted file mode 100644 index 6afee6450..000000000 --- a/kholidays/holidays/holiday_catalan +++ /dev/null @@ -1,29 +0,0 @@ -: -: Catalan holidays -: Jordi Saludes -: Last modified on Apr 24 1999 -: -: -: fixed -: -"Any nou" on 1/1 -"Reis" on 1/6 -small "Sant Jordi" on 4/23 -"Primer de Maig" on 5/1 -"Sant Joan" on 6/24 -"Mare de Déu d'Agost" on 8/15 -"Diada Nacional" on 9/11 -"Pilar" on 10/12 -"Tots Sants" on 11/1 -"Constitució" on 12/6 -"Immaculada" on 12/8 -"Nadal" on 12/25 -: -: mobile -: -small "Dijous Sant" weekend on easter minus 3 days -small "Divendres Sant" weekend on easter minus 2 days -small "Pasqua" weekend on easter -small "Dimecres de cendra" on easter minus 46 days -small "Pentecosta" weekend on easter plus 49 days - diff --git a/kholidays/holidays/holiday_ch b/kholidays/holidays/holiday_ch deleted file mode 100644 index 8dd0e3c53..000000000 --- a/kholidays/holidays/holiday_ch +++ /dev/null @@ -1,17 +0,0 @@ -: -: Swiss holiday file. Copy to ~/.holiday -: Use this as a starting point, some holidays are missing, and some listed -: here are largely irrelevant. -: -: Author: Christian Iseli -: -red "Nouvel-An" weekend on 1/1 -red "Vendredi Saint" weekend on easter minus 2 days -red "Paques" weekend on easter -red "Ascension" weekend on easter plus 39 days -red "Pentecote" weekend on easter plus 49 days -red "L. de Pentecote" weekend on easter plus 50 days -red "Noel" weekend on 12/25 -red "Premier Aout" weekend on august 1 -red "Jeune Federal" weekend on third sunday in september -red "Lundi du Jeune" weekend on third sunday in september plus 1 day diff --git a/kholidays/holidays/holiday_cl b/kholidays/holidays/holiday_cl deleted file mode 100644 index a8a625298..000000000 --- a/kholidays/holidays/holiday_cl +++ /dev/null @@ -1,37 +0,0 @@ -: -: Chilean holiday file -: -: See: http://www.farah.cl/Feriados -: Thanks: Miguel Farah -: -: Author: Nicolas Troncoso - - -: National holidays -small "Año Nuevo" weekend on 1/1 -small "Viernes Santo" weekend on easter minus 2 -small "Sabado Santo" weekend on easter minus 1 -small "Día Nacional del Trabajador" weekend on 5/1 -small "Día de las Glorias Navales" weekend on 5/21 -small "San Pedro y San Pablo" weekend on (([6/29] == [tuesday after ([6/28])] || [6/29] == [wednesday after ([6/28])] || [6/29] == [thursday after ([6/28])] )? [monday before ([6/29])]: (([6/29] == [friday after ([6/28])])? [monday after ([6/29])]:[6/29])) -small "Virgen del Carmen" weekend on 7/16 -small "Asunción de la Virgen" weekend on 8/15 -small "Día de la Independencia" weekend on 9/18 -small "Día de las Glorias del Ejército" weekend on 9/19 -:small "sandwich dieciochero" weekend on (([9/17] == [monday after ([9/16])])? ([9/17]):(([9/20] == [friday after ([9/19])])? ([9/20]) : MISSING NOOP COMMAND)) -small "Día de la Raza" weekend on (([10/12] == [tuesday after ([10/11])] || [10/12] == [wednesday after ([10/11])] || [10/12] == [thursday after ([10/11])] )? [monday before ([10/12])]: (([10/12] == [friday after ([10/11])])? [monday after ([10/12])]:[10/12])) -small "Día Nacional de las Iglesias Evangélicas y Protestantes" weekend on (([10/31] == [tuesday after ([10/30])])? [friday before ([10/31])]: (([10/31] == [wednesday after ([10/30])])? [friday after ([10/31])]: [10/31])) -small "Día de Todos los Santos" weekend on 11/1 -small "Inmaculada Concepción de la Virgen" weekend on 12/8 -small "Navidad" weekend on 12/25 -small "Feriado Bancario de Fin de año" weekend on 12/31 - -: Non-workable days -small "Elecciones Prescidenciales" weekend on 12/13/2009 - - -: Jewish and Islamic holidays not easy to calculate - -: Interesting dates - -: Seasons diff --git a/kholidays/holidays/holiday_co b/kholidays/holidays/holiday_co deleted file mode 100644 index 57529c7e8..000000000 --- a/kholidays/holidays/holiday_co +++ /dev/null @@ -1,27 +0,0 @@ -: -: Archivo holiday_colombia. Cópialo a ~/.holiday -: Modifica este archivo borrando y añadiendo lo que te parezca. -: -: Festivos -: -red "Año nuevo" red on january 1 -red "Reyes magos" red on monday after january 6 -red "San José" red on march 24 -red "Día del Trabajo" red on may 1 -red "Dia de la ascención" red on june 2 -red "Día del Corpus" red on monday after june 23 -red "San Pedro y San Pablo" red on monday after june 30 -red "Sagrado Corazón" red on monday after june 30 -red "Día de la Independencia" red on july 20 -red "Fiesta de la Batalla de Boyaca" red on august 7 -red "Asunción" red on monday after august 18 -red "Día de la Raza" red on october 13 -red "Todos los Santos" red on monday after november 3 -red "Independencia de Cartagena" red on november 17 -red "La Inmaculada" red on december 8 -red "Día de Navidad" red on december 25 -: -: Relacionados con la pascua -: -small "Jueves Santo" weekend on easter minus 3 days -small "Viernes Santo" weekend on easter minus 2 days diff --git a/kholidays/holidays/holiday_cz b/kholidays/holidays/holiday_cz deleted file mode 100644 index e0838a66d..000000000 --- a/kholidays/holidays/holiday_cz +++ /dev/null @@ -1,18 +0,0 @@ -: -: Czech holiday file. -: Author: Miroslav Flídr -: -small "Nový rok" weekend on 1.1. -small "Velikonoce" weekend on easter -small "Velikonoční pondělí" weekend on easter plus 1 days -small "Svátek práce" weekend on 1.5. -small "Státní svátek - Den osvobození" weekend on 8.5. -small "Státní svátek - Den slovanských věrozvěstů Cyrila a Metoděje" weekend on 5.7. -small "Statní svátek - Mistr Jan Hus" weekend on 6.7. -small "Státní svátek - Den České státnosti" weekend on 28.9. -small "Státní svátek - Den vzniku samostatného Československa (1918)" weekend on 28.10. -small "Státní svátek - Den boje studentů za svobodu a demokracii" weekend on 17.11. -small "Štědrý den" weekend on 24.12. -small "1. svátek vánoční" weekend on 25.12. -small "2. svátek vánoční" weekend on 26.12. -small blue "Silvestr" on 31.12. diff --git a/kholidays/holidays/holiday_de b/kholidays/holidays/holiday_de deleted file mode 100644 index ba2f4b1a0..000000000 --- a/kholidays/holidays/holiday_de +++ /dev/null @@ -1,30 +0,0 @@ -: -: German holiday file. Copy to ~/.holiday -: Bavarians please add the weekend keyword everywhere, and sprinkle -: generously with more obscure catholic holidays. -: -small "Neujahr" weekend on 1.1. -small "Hl. 3 Könige" on 6.1. -blue "Sommerzeit" on last sunday in march -small "Rosenmontag" on easter minus 48 days -small "Fasching" on easter minus 47 days -small "Aschermittwoch" on easter minus 46 days -small "Karfreitag" weekend on easter minus 2 days -small "Ostern" weekend on easter length 2 days -small "Pfingsten" weekend on easter plus 49 days length 2 days -small "Himmelfahrt" weekend on easter plus 39 days -small "Fronleichnam" on easter plus 60 days -small "1. Mai" weekend on 1.5. -small "Muttertag" on second sunday in may -blue "Winterzeit" on last sunday in october -small "Tag d. Einheit" weekend on 3.10. -small "Reformationstag" on 31.10. -small "Allerheiligen" on 1.11. -small "Buß & Bettag" on sunday before 24.12. minus 32 days -small "1. Advent" on sunday before 24.12. minus 21 days -small "2. Advent" on sunday before 24.12. minus 14 days -small "3. Advent" on sunday before 24.12. minus 7 days -small "4. Advent" on sunday before 24.12. -small "Hl. Abend" on 24.12. -small "Weihnachten" weekend on 25.12. length 2 days -small "Silvester" on 31.12. diff --git a/kholidays/holidays/holiday_dk b/kholidays/holidays/holiday_dk deleted file mode 100644 index cab02bbfe..000000000 --- a/kholidays/holidays/holiday_dk +++ /dev/null @@ -1,59 +0,0 @@ -: -: Danish holiday file. -: (colors edited by thomas@bitrot.in-berlin.de) -: -: Helligdage -"Hellig tre Konger" on 6.1 -weekend "Fastelavn" weekend on easter minus 49 days -weekend "Palme søndag" weekend on easter minus 7 days -weekend "Skærtorsdag" weekend on easter minus 3 days -weekend "Langfredag" weekend on easter minus 2 days -weekend "Påskedag" weekend on easter -weekend "2. Påskedag" weekend on easter plus 1 day -weekend "Store bededag" weekend on easter plus 26 days -weekend "Kristi himmelfart" weekend on easter plus 39 days -weekend "Pinsedag" weekend on easter plus 49 days -weekend "2. Pinsedag" weekend on easter plus 50 days -"Skt. Hans dag" on 24.6 -"Mortensdag" on 11.11 -weekend "Juleaftensdag" weekend on 24.12 -weekend "Juledag" weekend on 25.12 -weekend "2. Juledag" weekend on 26.12 -weekend "1. Advent" weekend on sunday before 24.12 minus 21 days -weekend "2. Advent" weekend on sunday before 24.12 minus 14 days -weekend "3. Advent" weekend on sunday before 24.12 minus 7 days -weekend "4. Advent" weekend on sunday before 24.12 -: -: Nationle fridage -weekend "Nytårsdag" weekend on 1.1 -weekend "Grundlovsdag/Fars dag" weekend on 5.6 -: -: Nationale mærkedage -"Kampen ved Myslunde 1864" on 2.2 -"Stormen på København 1659" on second tuesday in february -"Slaget på reden 1801" on 2.4 -"Danmarks Besættelse 1940" on 9.4 -"Slaget ved Dybbøl 1864" on 18.4 -"Danmarks befrielse 1945" on 5.5 -"Kampen ved Helgoland 1864" on 9.5 -"Valdemarsdag/Genforeningsdag" on 15.6 -"Slaget ved Fredericia 1849" on 6.7 -"Slaget ved Isted 1850" on 25.7 -"Stormen på Frederiksstad 1850" on 4.10 -"FN-dag" on 24.10 -: -: Royale fødselsdage -"Kronprinsesse Mary" on 5.2 -"Dronning Margrete II" on 16.4 -"Prinsesse Benedikte" on 29.4 -"Kronprins Frederik" on 26.5 -"Prins Joachim" on 7.6 -"Prins Henrik" on 11.6 -"Prinsesse Alexandra" on 30.6 -"Prins Felix" on 22.7 -"Prins Nikolai" on 28.8 -: -: Andet -small blue "Sommertid" on last sunday in march -small blue "Vintertid" on last sunday in october -"Mors dag" on second sunday in may diff --git a/kholidays/holidays/holiday_ee b/kholidays/holidays/holiday_ee deleted file mode 100644 index fbb260d01..000000000 --- a/kholidays/holidays/holiday_ee +++ /dev/null @@ -1,38 +0,0 @@ -: Estonian holiday file. Copy to ~/.holiday -: -: Author: Hasso Tepper - -: Rahvuslik püha -red "Iseseisvuspäev" on 24 february - -: Riigipühad -red "Uusaasta" on 1 january -red "Kevadpüha" on 1 may -red "Võidupüha" on 23 june -red "Jaanipäev" on 24 june -red "Taasiseseisvumispäev" on 20 august -red "Esimene jõulupüha" on 25 december -red "Teine jõulupüha" on 26 december - -red "Suur reede" on easter minus 2 days -red "Ülestõusmispühade 1. püha" on easter -red "Nelipühade 1. püha" on easter plus 49 days - -: Riiklikud tähtpäevad -blue "Kolmekuningapäev" on 6 january -blue "Tartu rahulepingu aastapäev" on 2 february -blue "Emakeelepäev" on 14 march -blue "Emadepäev" on second sunday in may -blue "Leinapäev" on 14 june -blue "Hingedepäev" on 2 november -blue "Isadepäev" on second sunday in november -blue "Taassünnipäev" on 16 november - -: Muud tähtpäevad -blue "Naistepäev" on 8 march - -red "1. advent" on sunday before 24 december minus 21 days -red "2. advent" on sunday before 24 december minus 14 days -red "3. advent" on sunday before 24 december minus 7 days -red "4. advent" on sunday before 24 december - diff --git a/kholidays/holidays/holiday_es b/kholidays/holidays/holiday_es deleted file mode 100644 index 196bbab73..000000000 --- a/kholidays/holidays/holiday_es +++ /dev/null @@ -1,88 +0,0 @@ -: -: holiday_es -- Defines spanish holidays -: -: For corrections, comments, etc., write to kde-es@kybs.de -: Para correcciones, comentarios, etc., escriba a kde-es@kybs.de - -:: -:: Holidays in all parts of Spain -:: -: http://www.mtas.es/infpuntual/Fiestas2005/caracteristicas.htm -: «se respetarán como fiestas de ámbito nacional las de -: la Natividad del Señor, -: Año Nuevo, -: 1 de Mayo como fiesta del Trabajo, -: y 12 de Octubre como fiesta Nacional de España.» -"Año nuevo" weekend on january 1 -"Fiesta del Trabajo" weekend on may 1 -"Fiesta Nacional de España" weekend on october 12 -"Natividad del Señor" weekend on december 25 - -: http://www.mtas.es/infpuntual/Fiestas2005/RES061004.htm -: «Fiesta Nacional no sustituible» -"Asunción de la Virgen" weekend on august 15 -"Todos los Santos" weekend on november 1 -"Día de la Constitución Española" weekend on december 6 -"La Inmaculada Concepción" weekend on december 8 - -: http://www.mtas.es/infpuntual/Fiestas2005/RES061004.htm -: «Fiesta Nacional respecto de la que no se ha ejercido la facultad -: de sustitución.» -"Epifanía del Señor" weekend on january 6 -small "San Esteban" on december 26 - - -:: -:: Easter related -:: -small "Jueves Santo" on easter minus 3 days -"Viernes Santo" weekend on easter minus 2 days -small "Lunes de Pascua" on easter plus 1 day -small "Pentecostes / 2º Pascua" on easter plus 50 days - - -:: -:: Holidays of the autonomic communities -:: -small "Día de Andalucía" on february 28 - -small "Día de las Islas Baleares" on march 1 -small "San José" on march 19 - -small "Sant Jordi" on april 23 -small "Fiesta de la Comunidad de Castilla y León" on april 23 -small "Día de Aragón" on april 23 - -small "Fiesta de la Comunidad de Madrid" on may 3 -small "Día de las Letras Gallegas" on may 17 -small "Día de Canarias" on may 30 -small "Día de la Región de Castilla y la Mancha" on may 31 - -small "Día de la Región de Murcia" on june 9 -small "Día de la Rioja" on june 9 -small "San Juan" on june 24 - -small "Santiago Apóstol" on july 25 -small "Día de las Instituciones" on july 28 - -small "Día de la Ciudad Autónoma de Ceuta" on september 2 -small "Día de Asturias" on september 8 -small "Día de Extremadura" on september 8 -small "Diada de Cataluña" on september 11 -small "Ntra. Sra. de la Bien Aparecida" on september 15 - - -:: -:: Daylight saving time -:: -small "Adelanto horario" on last sunday in march -small "Retraso horario" on last sunday in october - - -:: -:: Seasons -:: -small "Equinoccio e inicio de primavera" on march 21 -small "Solsticio e inicio de verano" on june 21 -small "Equinoccio e inicio de otoño" on september 23 -small "Solsticio e inicio de invierno" on december 21 diff --git a/kholidays/holidays/holiday_fi b/kholidays/holidays/holiday_fi deleted file mode 100644 index 6f05cd75a..000000000 --- a/kholidays/holidays/holiday_fi +++ /dev/null @@ -1,82 +0,0 @@ -: Finnish holiday file. Copy to ~/.holiday -: -: Author: Steven Wahlberg -: -: $Id$ - -: pääsiäisen määräämät -red "Laskiaissunnuntai" on easter minus 49 days -red "Laskiaistiistai" on easter minus 47 days -red "Marianpäivä" on easter minus 14 days -red "Palmusunnuntai" on easter minus 7 days -red "Pitkäperjantai" weekend on easter minus 2 days -red "Pääsiäinen" weekend on easter -red "2. pääsiäispäivä" weekend on easter plus 1 days -red "Rukoussunnnuntai" weekend on easter plus 35 days -red "Helatorstai" weekend on easter plus 39 days -red "Helluntaipäivä" on easter plus 49 days - -: Kaikki muut -blue "Uudenvuodenpäivä" weekend on 1 january -red "Loppiainen" weekend on 6 january - -blue "Runebergin päivä" on 5 february -blue "Ystävänpäivä" on 14 february -: karkauspäivä vain karkausvuotena. Kuinka määritellään plan:lle? -: blue "Karkauspäivä" on 29 february minus 5 days -blue "Karkauspäivä" on 24 february 1964 -blue "Karkauspäivä" on 24 february 1968 -blue "Karkauspäivä" on 24 february 1972 -blue "Karkauspäivä" on 24 february 1976 -blue "Karkauspäivä" on 24 february 1980 -blue "Karkauspäivä" on 24 february 1984 -blue "Karkauspäivä" on 24 february 1988 -blue "Karkauspäivä" on 24 february 1992 -blue "Karkauspäivä" on 24 february 1996 -blue "Karkauspäivä" on 24 february 2000 -blue "Karkauspäivä" on 24 february 2004 -blue "Karkauspäivä" on 24 february 2008 -blue "Karkauspäivä" on 24 february 2012 -blue "Karkauspäivä" on 24 february 2016 -blue "Karkauspäivä" on 24 february 2020 -blue "Karkauspäivä" on 24 february 2024 -blue "Karkauspäivä" on 24 february 2028 -blue "Karkauspäivä" on 24 february 2032 -blue "Karkauspäivä" on 24 february 2036 -blue "Karkauspäivä" on 24 february 2040 -blue "Kalevalan päivä" on 28 february - -blue "Naistenpäivä" on 8 march -cyan "Kesäaika alkaa (+1)" on last sunday in march - -blue "Agricolan päivä" on 9 april -blue "Veteraanipäivä" on 27 april - -blue "Vappu" weekend on 1 may -blue "Äitienpäivä" on second sunday in may -blue "Snellmanin päivä" on 12 may -blue "Kaatuneiden muistopäivä" on third sunday in may - -blue "Puolustusvoimien lippujuhla" on 4 june -blue "Juhannuspäivä" weekend on saturday after 20 june - -blue "Eino Leinon päivä" on 6 july -blue "Unikeonpäivä" on 27 july - -blue "Kansainvälinen lasten päivä" on 7 october -blue "Aleksis Kiven päivä" on 10 october -blue "YK:n päivä" on 24 october -cyan "Kesäaika päättyy (-1)" on last sunday in october - -red "Pyhäinpäivä" weekend on first saturday in november -blue "Svenska dagen" on 6 november -blue "Isänpäivä" on second sunday in november - -red "1. adventtisunnuntai" on sunday before 24 december minus 21 days -red "2. adventtisunnuntai" on sunday before 24 december minus 14 days -red "3. adventtisunnuntai" on sunday before 24 december minus 7 days -red "4. adventtisunnuntai" on sunday before 24 december -blue "Itsenäisyyspäivä" weekend on 6 december -red "Joulupäivä" weekend on 25 december -red "Tapaninpäivä" weekend on 26 december -blue "Viattomien lasten päivä" on 28 december diff --git a/kholidays/holidays/holiday_fr b/kholidays/holidays/holiday_fr deleted file mode 100644 index f46d21685..000000000 --- a/kholidays/holidays/holiday_fr +++ /dev/null @@ -1,29 +0,0 @@ -: -: French holiday file. Copy to ~/.holiday -: -: en vert les saisons -: en bleu (texte) et rouge (jour) les jours ferie's -: en cyan d'autres fetes non ferie'es ou dimanche -: Je suis pas sur pour les fetes des peres et des meres -: -: Author: Jean-Claude Giese -: -blue "Jour de l'An" weekend on 1.1. -cyan "Epiphanie" on first sunday in january -green "Printemps" on 20.3. -blue "Pâques" weekend on easter length 2 days -blue "Pentecôte" weekend on easter plus 49 days length 2 days -blue "Ascension" weekend on easter plus 39 days -blue "Fête du travail" weekend on 1.5. -blue "Armistice 1945" weekend on 8.5. -green "Eté" on 21.6. -blue "Fête Nationale" weekend on 14.7. -blue "Assomption" weekend on 15.8. -cyan "Fête des mères" on last sunday in may -cyan "Fête des pères" on third sunday in june -green "Automne" on 23.9. -blue "Toussaint" weekend on 1.11. -blue "Armistice 1918" weekend on 11.11. -green "Hiver" on 21.12. -blue "Noël" weekend on 25.12. -cyan "St Sylvestre" on 31.12. diff --git a/kholidays/holidays/holiday_frswiss b/kholidays/holidays/holiday_frswiss deleted file mode 100644 index 79c1380cd..000000000 --- a/kholidays/holidays/holiday_frswiss +++ /dev/null @@ -1,17 +0,0 @@ -: -: Swiss holiday file. Copy to ~/.holiday -: Use this as a starting point, some holidays are missing, and some listed -: here are largely irrelevant. -: -: Author: Christian Iseli -: -red "Nouvel-An" weekend on 1/1 -red "Vendredi Saint" weekend on easter minus 2 days -red "Paques" weekend on easter -red "Ascension" weekend on easter plus 39 days -red "Pentecote" weekend on easter plus 49 days -red "L. de Pentecote" weekend on easter plus 50 days -red "Noel" weekend on 12/25 -red "Premier Aout" weekend on august 1 -red "Jeune Federal" weekend third sunday in september -red "Lundi du Jeune" weekend third sunday in september plus 1 day diff --git a/kholidays/holidays/holiday_gb b/kholidays/holidays/holiday_gb deleted file mode 100644 index 0347f8dc5..000000000 --- a/kholidays/holidays/holiday_gb +++ /dev/null @@ -1,14 +0,0 @@ -: -: England & Wales holiday file. Copy to ~/.holiday -: -: Author: Peter Lord -: -"New Years Day" red on 1/1 -"Easter Sunday" red on easter -"Good Friday" red on easter minus 2 -"Easter Monday" red on easter plus 1 -"May Day" red on first monday in may -"Spring Bank Holiday" red on last monday in may -"Summer Bank Holiday" red on last monday in august -"Christmas Day" red on 12/25 -"Boxing Day" red on 12/26 diff --git a/kholidays/holidays/holiday_gr b/kholidays/holidays/holiday_gr deleted file mode 100644 index 80257850f..000000000 --- a/kholidays/holidays/holiday_gr +++ /dev/null @@ -1,309 +0,0 @@ -: -: Greek holiday file. -: -: Author: capthookb (praktoreio2002@yahoo.gr) -: -: "weekend" or "red" indicate a "proper" holiday (i.e. you do not work) -: Other colours (black, green, yellow, blue, magenta, cyan, white) -: can be used to distinguish between minor anniversaries or not-so-real -: holidays, when you go working anyway. -: "small" holidays are not as "invasive" in the month view in KOrganizer, -: and do not take as much space. - -: Ονομαστικές εορτές - -small black "Βασίλης, Βασιλική, Βασιλεία, Βίβιαν" on 1.1 -small black "Συλβέστρος" on 2.1 -small black "Θεώνη" on 5.1 -small black "Άγια Θεοφάνεια (Αργία)" on 6.1 -small black "Φώτης, Φωτεινή, Θεοφάνης, Θεοφανία, Φανή, Ιορδάνης, Θεανώ, Ουρανία, Θεοπούλα" on 6.1 -small black "Ιωάννης, Ιωάννα, Πρόδρομος" on 7.1 -small black "Αγάθων, Δομινίκη, Παρθένα, Κύρος" on 8.1 -small black "Θεοδόσης, Θεοδοσία" on 11.1 -small black "Τατιάνα, Τατιανή" on 12.1 -small black "Αντώνης, Αντωνία" on 17.1 -small black "Αθανάσιος, Αθανασία, Κύριλλος" on 18.1 -small black "Μακάριος" on 19.1 -small black "Ευθύμης, Ευθυμία, Φαβιανός" on 20.1 -small black "Αγνή, Μάξιμος, Νεόφυτος, Πάτροκλος" on 21.1 -small black "Τιμόθεος, Αναστάσιος, Αναστασία" on 22.1 -small black "Αγαθάγγελος" on 23.1 -small black "Ξένη, Φίλωνας, Ζωσιμάς" on 24.1 -small black "Γρηγόρης, Γρηγορία, Μαργαρίτα" on 25.1 -small black "Ξενοφών" on 26.1 -small black "Χάρις, Παλλάδιος" on 28.1 -small black "Μαύρος, Χρυσή, Τριών Ιεραρχών (Σχολική Αργία)" on 30.1 -small black "Ευδοξία, Κύρος" on 31.1 -small black "Τρύφωνας" on 1.2 -small black "Υπαπαντή" on 2.2 -small black "Σταμάτ-ης/ία, Συμεώ-ν/νή, Σιμώνη, Ασημάκης, Ασημίνα, Μαλαματή" on 3.2 -small black "Ισίδωρος, Ιάσιμος, Ιασίμη" on 4.2 -small black "Αγαθή" on 5.2 -small black "Φώτης" on 6.2 -small black "Παρθένιος, Παρθενία" on 7.2 -small black "Ζαχαρίας, Ζαχαρούλα" on 8.2 -small black "Μάρκελος, Νικηφόρος, Νίκη" on 9.2 -small black "Χαράλαμπος, Χαραλαμπία, Χαρίκλεια, Χαρίλαος, Χαρούλα" on 10.2 -small black "Βλάσης, Βλασία, Θοδωρής, Θοδώρα, Αυγή " on 11.2 -small black "Μελέτης, Πλωτίνος" on 12.2 -small black "Πρίσκιλλα" on 13.2 -small black "Βαλεντίνος, Βαλεντίνη, Παγκόσμια Ημέρα Ερωτευμένων" on 14.2 -small black "Ευσέβιος, Ευσεβία" on 15.2 -small black "Πάμφιλος, Παμφίλη, Σέλευκος, Σελεύκη" on 16.2 -small black "Λέων, Αγαπητός" on 18.2 -small black "Φιλοθέη, Χλόη" on 19.2 -small black "Ανθούσα" on 22.2 -small black "Πολύκαρπος" on 23.2 -small black "Πορφύρης, Φωτεινή" on 26.2 -small black "Μαριάννα, Ασκληπιός" on 28.2 -small black "Ευδοκία, Χαρίσιος" on 1.3 -small black "Ευθαλία" on 2.3 -small black "Κλεόνικος, Κλεονίκη" on 3.3 -small black "Αρχέλαος, Eυλόγιος" on 5.3 -small black "Ησύχιος" on 6.3 -small black "Ευγένιος, Ευγενία" on 7.3 -small black "Ερμής, Θεοφύλακτος, Παγκόσμια Ημέρα της Γυναίκας" on 8.3 -small black "Σμάραγδος, Σμαράγδα, Ηλιάνα, Λεόντιος, Λεοντία, Λυσίμαχος Λυσιμαχη" on 9.3 -small black "Ξάνθος, Ξανθούλα, Σαράντης Σαραντούλα, Φιλοκτήμων" on 9.3 -small black "Θεόδωρος Θεοδώρα, Θώδος, Θώδη, Θαλλής, Θάλεια, Σωφρόνιος, Σωφρονία" on 11.3 -small black "Λωξάντρα, Ρωξάνη, Oρθοδόξης," on 12.3 -small black "Λέανδρος" on 13.3 -small black "Βενέδικτος, Βενεδίκτη" on 14.3 -small black "Αγάπιος" on 15.3 -small black "Χριστόδουλος, Ιουλιανός" on 16.3 -small black "Αλέξιος, Αλεξία" on 17.3 -small black "Χρύσανθος, Χρυσάνθη" on 19.3 -small black "Δρόσος, Δροσούλα" on 22.3 -small black "Ευαγγελισμός της Θεοτόκου " on 25.3 -small black "Ευάγγελος, Ευαγγελία" on 25.3 -small black "Πούλιος, Σύλας, Σύλια" on 26.3 -small black "Λυδία, Μακεδόνιος, Μακεδονούλα" on 27.3 -small black "Ευτύχιος, Ευτυχία" on 6.4 -small black "Ιωσήφ, Ιωσηφίνα" on 9.4 -small black "Δημοσθένης, Ηρακλής, Μιλτιάδης, Περικλής, Σοφοκλής, Επαμεινώνδας" on 10.4 -small black "Όμηρος, Πελοπίδας, Παρμενίων, Πολύβιος, Αναξιμένης, Φοιλοποίμην, Φίλης" on 10.4 -small black "Αρίσταρχος, Θωμαΐς" on 14.4 -small black "Λεωνίδας, Λάζαρος" on 15.4 -small black "Βάϊος, Βάϊα, Δάφνη, Γαλήνη, Χιονία" on 16.4 -small black "Ναθαναήλ, Νέαρχος, Νιάρχος" on 22.4 -small black "Αναστάσιος, Αναστασία, Λάμπρος, Λαμπρινή, Πασχάλης " on 23.4 -small black "Γεώργιος, Γεωργία, Ελισάβετ, Αχιλλέας" on 24.4 -small black "Μάρκος, Νίκη, Ραφαήλ" on 25.4 -small black "Ζωή, Πηγή" on 28.4 -small black "Ιάσωνας" on 29.4 -small black "Ιάκωβος, Θωμάς, Θωμαή, Ασημίνα" on 30.4 -weekend "Ιερεμίας" on 1.5 -small black "Έσπερος, Εσπέρια" on 2.5 -small black "Ροδόπη" on 3.5 -small black "Ειρήνη, Eιρηναίος, Ευφραίμ" on 5.5 -small black "Μυροφόρα" on 7.5 -small black "Θεολόγος" on 8.5 -small black "Χριστόφορος, Ησαΐας" on 9.5 -small black "Σίμων" on 10.5 -small black "Aρμόδιος,Μεθόδιος, Ολυμπία" on 11.5 -small black "Επιφάνειος" on 12.5 -small black "Γλυκερία" on 13.5 -small black "Γιορτή της Μητέρας, Αριστοτέλης" on 14.5 -small black "Καλή" on 15.5 -small black "Ανδρόνικος, Ανδρονίκη, Ιουνία" on 17.5 -small black "Ιουλία, Γαλάτεια" on 18.5 -small black "Θεόκτιστος, Μαγδαληνή, Πατρίκιος" on 19.5 -small black "Λυδία" on 20.5 -small black "Κωνσταντίνος, Κωνσταντίνα, Ελένη" on 21.5 -small black "Αιμίλιος, Αιμιλία, Έμυ" on 22.5 -small black "Μαρκιανή" on 24.5 -small black "Θεοδοσία" on 29.5 -small black "Πύρρος, Νεφέλη, Ιουστίνος, Ανάληψη" on 1.6 -small black "Νικηφόρος, Μαρίνος" on 2.6 -small black "Υπάτιος, Υπατία" on 3.6 -small black "Μάρθα" on 4.6 -small black "Aπόλλων, Δωρόθεος, Δωροθέα, Σελήνη, Νίκανδρος" on 5.6 -small black "Καλλιόπη" on 8.6 -small black "Ροδάνθη" on 9.6 -small black "Βαρθολομαίος, Βαρνάβας" on 11.6 -small black "Ονούφριος, Ζήνων,Κορίνα, Αγίου Πνεύματος" on 12.6 -small black "Ελισαίος" on 14.6 -small black "Αυγουστίνος, Αυγούστα, Ιερώνυμος, Μόνικα, Ορτανσία" on 15.6 -small black "Γιορτή του πατέρα" on 16.6 -small black "Έρασμος, Ερασμία, Aγίων Πάντων" on 18.6 -small black "Παΐσιος, Ζωσιμάς, Ζήσης" on 19.6 -small black "Ευσέβιος, Ευσεβία" on 22.6 -small black "Αριστοκλής" on 23.6 -small black "Φεβρωνία, Έρωτας" on 25.6 -small black "Γερμανός" on 28.6 -small black "Πέτρος, Πέτρα, Παύλος, Παυλίνα" on 29.6 -small black "Απόστολος, Αποστολία, Μελίτων" on 30.6 -small black "Αργύρης, Αργυρώ, Κοσμάς, Δαμιανός, Ανάργυρος" on 1.7 -small black "Υάκινθος, Ζουμπουλία" on 3.7 -small black "Λουκία" on 4.7 -small black "Λυκίας, Λύκιος, Λυκία, " on 6.7 -small black "Κυριακή" on 7.7 -small black "Θεόφιλος, Προκόπιος" on 8.7 -small black "Ευφημία, Όλγα" on 11.7 -small black "Βερονίκη, Βερενίκη " on 12.7 -small black "Σάρα" on 13.7 -small black "Ακύλας, Νικόδημος" on 14.7 -small black "Βλαδίμηρος, Ιουλίττα, Κήρυκος" on 15.7 -small black "Μαρίνα" on 17.7 -small black "Αιμίλιος, Αιμιλία" on 18.7 -small black "Ηλίας, Ηλιάνα" on 20.7 -small black "Μαγδαληνή, Μαρκέλλα, Μαριλένα" on 22.7 -small black "Φωκάς" on 23.7 -small black "Αθηναγόρας" on 24.7 -small black "Άννα, Ολυμπία" on 25.7 -small black "Παρασκευή, Παρασκευάς, Έρση" on 26.7 -small black "Παντελής" on 27.7 -small black "Ειρήνη, Χρυσοβαλάντης, Βαλάντης, Χρυσοβαλάντου, Ακάκιος" on 28.7 -small black "Καλλίνικος" on 29.7 -small black "Ανδρόνικος, Ανδρονίκη" on 30.7 -small black "Ιωσήφ, Ιωσηφίνα" on 31.7 -small black "Μάρκελος" on 1.8 -small black "Σωτήρης, Σωτηρία, Ευμορφία, Έμμυ, Μορφούλα" on 6.8 -small black "Αστέριος, Αστερία" on 7.8 -small black "Τριαντάφυλλος, Τριανταφυλλιά" on 8.8 -small black "Ρωμανός" on 9.8 -small black "Λαυρέντης, Λαυρεντία, Ευλαμπία, Ιππόλυτος, Ηρώ " on 10.8 -weekend "Κοίμηση της Θεοτόκου (Αργία)" on 15.8 -weekend "Μαρία, Μάριος, Παναγιώτης, Παναγιώτα, Δέσποινα, Θεοτόκης" on 15.8 -small black "Γεράσιμος, Αλκιβιάδης, Διομήδης, Σαράντης" on 16.8 -small black "Λευκοθέα, Μύρων, Μίρκα" on 17.8 -small black "Φλώρα" on 18.8 -small black "Σαμουήλ, Θεοχάρης" on 20.8 -small black "Aγαθόνικος" on 22.8 -small black "Κοσμάς" on 24.8 -small black "Βαρθολομαίος, Τίτος" on 25.8 -small black "Ναταλία, Ανδριανός, Ανδριανή" on 26.8 -small black "Φανούριος, Φανουρία, Αρκαδία" on 27.8 -small black "Θεοπίστη" on 29.8 -small black "Αλέξανδρος" on 30.8 -small black "Αδαμάντιος, Αδαμαντία, Αθηνά, Αντιγόνη, Ασπασία, Αφροδίτη, Δωδώνη" on 1.9 -small black "Ελπινίκη, Ερασμία, Ερατώ, Ευτέρπη, Θάλεια, Θεανώ, Καλλίστη, Κλειώ, Κλεονίκη" on 1.9 -small black "Κλεοπάτρα, Κοραλία, Μαργαρίτα, Μαριάνθη, Μελέτιος, Μελπομένη, Ουρανία" on 1.9 -small black "Πανδώρα, Πηνελόπη, Πολυμνία, Πολυνίκη, Σαπφώ, Συμεών, Τερψιχόρη, Χάιδω" on 1.9 -small black "Άνθιμος, Πολύδωρος, Φοίβη" on 3.9 -small black "Ερμιόνη, Μωυσής" on 4.9 -small black "Ζαχαρίας" on 5.9 -small black "Κασσιανή, Σώζων" on 7.9 -small black "Ιωακείμ" on 9.9 -small black "Εράστη, Εράστος, Μητροδώρα, Πουλχερία" on 10.9 -small black "Ευανθία" on 11.9 -small black "Αριστείδης, Κορνήλιος" on 13.9 -small black "Σταύρος, Σταυρούλα" on 14.9 -small black "Νικήτας, Βησσαρίων" on 15.9 -small black "Ευφημία" on 16.9 -small black "Σοφία, Ελπίδα, Αγάπη, Πίστη, Σόνια" on 17.9 -small black "Αριάδνη" on 18.9 -small black "Ευστάθιος, Ευσταθία" on 20.9 -small black "Ίωνας" on 21.9 -small black "Φωκάς, Ζωγραφιά" on 22.9 -small black "Πολυξένη, Ξανθίππη, Ξάνθιππος" on 23.9 -small black "Θέκλα, Μυρσίνη, Μυρτώ" on 24.9 -small black "Ευφροσύνη" on 25.9 -small black "Ζήνων" on 27.9 -small black "Κυριάκος, Κυριακή" on 29.9 -small black "Θηρεσία" on 1.10 -small black "Κυπριανός" on 2.10 -small black "Διονύσης, Διονυσία" on 3.10 -small black "Ιερόθεος, Φραγκίσκος" on 4.10 -small black "Χαριτινή" on 5.10 -small black "Σέργιος, Πολυχρόνης, Χρόνης" on 7.10 -small black "Πελαγία" on 8.10 -small black "Ευλάμπιος, Ευλαμπία" on 10.10 -small black "Ανδρομάχη, Ανδρόμαχος" on 12.10 -small black "Αγαθονίκη, Φλωρέντιος, Φλωρεντία" on 13.10 -small black "Λουκιανός" on 15.10 -small black "Λουκάς" on 18.10 -small black "Γεράσιμος, Αρτέμιος" on 20.10 -small black "Σωκράτης, Χριστόδουλος, Όυρσουλα" on 21.10 -small black "Αβέρκιος" on 22.10 -small black "Ιάκωβος" on 23.10 -small black "Χρυσάφης" on 25.10 -small black "Δημήτριος, Δήμητρα, Δανάη" on 26.10 -small black "Νέστορας" on 27.10 -small black "Ζηνοβία, Κλεόπας, Μαρκιανός" on 30.10 -small black "Αριστόβουλος" on 31.10 -small black "Αργύρης, Αργυρώ, Κοσμάς, Δαμιανός, Ανάργυρος" on 1.11 -small black "Αφθόνιος, Αφθονία" on 2.11 -small black "Ιωαννίκη" on 4.11 -small black "Λίνος" on 5.11 -small black "Λεονάρδος" on 6.11 -small black "Αθηνόδωρος" on 7.11 -small black "Σταμάτιος, Σταματία, Μιχάλης, Γαβριήλ, Γαβριέλα" on 8.11 -small black "Ταξιάρχης, Άγγελος, Αγγελική, Ματίνα, Σεραφείμ" on 8.11 -small black "Νεκτάριος, Νεκταρία" on 9.11 -small black "Ορέστης" on 10.11 -small black "Μηνάς, Mήνα, Βίκτωρ, Βικτωρία" on 11.11 -small black "Χρυσόστομος" on 13.11 -small black "Φίλιππος" on 14.11 -small black "Ματθαίος, Ιφιγένεια" on 16.11 -small black "Πλάτωνας" on 18.11 -small black "Μαρία, Μάριος" on 21.11 -small black "Φιλήμων" on 22.11 -small black "Μερώπη" on 23.11 -small black "Κατερίνα, Μερκούριος" on 25.11 -small black "Στέλιος, Στέλλα, Στέργιος" on 26.11 -small black "Φαίδρα" on 29.11 -small black "Ανδρέας, Ανδριάνα" on 30.11 -small black "Θεόκλητος, Ιακώβ" on 1.12 -small black "Βαρβάρα, Δαμασκηνός" on 4.12 -small black "Σάββας, Σαββούλα, Διογένης" on 5.12 -small black "Νίκος, Νικολέττα" on 6.12 -small black "Αμβρόσιος" on 7.12 -small black "Άννα" on 9.12 -small black "Ααρών, Αδάμ, Δαυίδ, Δανάη, Εύα, Ισαάκ, Ιώβ, Ραχήλ, Ρουμπίνη" on 11.12 -small black "Σπύρος, Σπυριδούλα" on 12.12 -small black "Ευστράτιος, Λουκάς, Λουκία, Άρης" on 13.12 -small black "Ελευθέριος, Ελευθερία, Ανθή, Σύλβια" on 15.12 -small black "Διονύσης, Διονυσία, Δανιήλ, Ρεβέκα, Σεβαστιανός, Σεβαστή" on 17.12 -small black "Ααρών, Αδάμ, Ισαάκ, Ραχήλ, Σάρα" on 17.12 -small black "Αγλαΐα" on 19.12 -small black "Ιγνάτιος" on 20.12 -small black "Θεμιστοκλής, Ιουλία" on 21.12 -small black "Αναστασία" on 22.12 -small black "Ευγένιος, Ευγενία" on 24.12 -small black "Χρήστος, Χριστίνα, Χρύσα" on 25.12 -weekend "Σύναξις Θεοτόκου (Αργία)" on 26.12 -weekend "Μανώλης, Εμμανουέλα, Δαβίδ" on 26.12 -small black "Στέφανος, Στεφανία" on 27.12 -small black "Δόμνα" on 28.12 -small black "Ιωσήφ" on 30.12 -weekend "Χριστούγεννα (Αργία)" on 25.12 - - -: Αργίες - Επέτειοι -weekend "Πρωτοχρονιά (Αργία)" on 1.1 -weekend "Πρωτομαγιά (Αργία)" on 1.5 -weekend "Επέτειος του ΟΧΙ (Αργία)" 28.10 -weekend "Επέτειος της επανάστασης του 1821 (Αργία)" on 25.3 -small black "Εξέγερση του Πολυτεχνείου (Σχολική Αργία)" on 17.11 - -: Κινητές εορτές - -small black "Τελώνου και Φαρισαίου - Αρχή Τριωδίου" on pascha minus 70 days -small black "Του Ασώτου" on pascha minus 63 days -small black "Τσικνοπέμπτη" on pascha minus 59 days -small black "Κυριακή των Απόκρεω" on pascha minus 56 days -small black "Τυροφάγου" on pascha minus 49 days -small black "Καθαρή Δευτέρα (Αργία)" on pascha minus 48 days -small black "Θεόδωρος, Θεοδώρα, Δώρα, Θώδης, Θώδος, Δώρης" on pascha minus 43 days -small black "Κυριακή της Ορθοδοξίας" on pascha minus 42 days -small black "Σάββατο του Λαζάρου" on pascha minus 8 days -small black "Κυριακή των Βαΐων" on pascha minus 7 days -small black "Μεγάλη Δευτέρα" on pascha minus 6 days -small black "Μεγάλη Τρίτη" on pascha minus 5 days -small black "Μεγάλη Τετάρτη" on pascha minus 4 days -small black "Μεγάλη Πέμπτη" on pascha minus 3 days -weekend "Μεγάλη Παρασκευή (Αργία)" on pascha minus 2 days -weekend "Μεγάλο Σάββατο" on pascha minus 1 days -weekend "Το Άγιον Πάσχα" on pascha -weekend "Δευτέρα του Πάσχα (Αργία)" on pascha plus 1 days -small black "Πηγή, Ζήσης, Ζησούλα, Ζήσιμος, Ζωή, Ζώης" on pascha plus 5 days -small black "Του Θωμά" on pascha plus 7 days -small black "Ανάληψη του Χριστού" on pascha plus 39 days -small black "Πεντηκοστή" on pascha plus 49 days -small black "Αγ. Πνεύματος" on pascha plus 50 days -small black "Αγ. Πάντων" on pascha plus 56 days - -: Αλλαγή ώρας -small black "Αλλαγή ώρας (1 ώρα πίσω)" on last sunday in october -small black "Αλλαγή ώρας (1 ώρα μπροστά) " on last sunday in march diff --git a/kholidays/holidays/holiday_gt b/kholidays/holidays/holiday_gt deleted file mode 100644 index 844367cef..000000000 --- a/kholidays/holidays/holiday_gt +++ /dev/null @@ -1,35 +0,0 @@ -: -: Fichero holiday_guatemala. Cópialo a ~/.holiday -: Modifica este fichero borrando y añadiendo lo que te parezca. -: -: Fiestas -: -red "Año nuevo" red on january 1 -red "Reyes" red on january 6 -red "Trabajo" red on march 19 -red "Ejército" red on may 1 -red "Virgen de la Asunción" red on august 15 -red "Independencia" red on september 15 -red "Revolucion de 1944" red on october 20 -red "Todos los Santos" red on november 1 -red "Nochebuena" red on december 24 -red "Navidad" red on december 25 -red "Fin de año" red on december 31 -: -: Relacionados con la pascua -: -small "Jueves Santo" weekend on easter minus 3 days -small "Viernes Santo" weekend on easter minus 2 days -small "Pascua" weekend on easter -small "Miércoles de ceniza" on easter minus 46 days -small "Pentecostes" weekend on easter plus 49 days -small "Ascension" on easter plus 39 days -small "Trinidad" on easter plus 46 days -small "Corpus Christi" on easter plus 60 days -: -: Estaciones -: -"Llega la Primavera" on march 20 -"Llega el Verano" on june 21 -"Llega el Otoño" on september 23 -"Llega el Invierno" on december 22 diff --git a/kholidays/holidays/holiday_hu b/kholidays/holidays/holiday_hu deleted file mode 100644 index e8f749a42..000000000 --- a/kholidays/holidays/holiday_hu +++ /dev/null @@ -1,26 +0,0 @@ -: -: Hungarian holidays -: Kelemen Péter -: Last modified on Jul 21 1997 -: -: public holidays -"Újév" weekend on 1/1 -"Nemzeti ünnep" weekend on 3/15 -"Húsvét" weekend on easter length 2 days -"Pünkösd" weekend on easter plus 49 length 2 days -"Munka ünnepe" weekend on 5/1 -"Szt. István, az államalapítás ünnepe" weekend on 8/20 -"Nemzeti ünnep" weekend on 10/23 -"Karácsony" weekend on 12/25 length 2 days - -: other events -small "Vízkereszt" on 1/6 -small "Valentin" on 2/14 -small "Nônap" on 3/8 -small "Anyák napja" on first sunday in may -small "Gyermeknap" on last sunday in may -small "Szentivánéj" on 6/24 -small "Mindenszentek napja" on 11/1 -small "Halottak napja" black on 11/2 -small "Mikulás" on 12/6 -small "Szilveszter" on 12/31 diff --git a/kholidays/holidays/holiday_ie b/kholidays/holidays/holiday_ie deleted file mode 100644 index f489f9600..000000000 --- a/kholidays/holidays/holiday_ie +++ /dev/null @@ -1,16 +0,0 @@ -: -: Holiday file for Ireland. -: -: Author: CP Hennessy -: -"New Years Day" red on 1/1 -"St Patricks Day (religious)" red on 3/17 -"Easter Sunday" red on easter -"Good Friday" red on easter minus 2 -"Easter Monday" red on easter plus 1 -"May Day" red on first monday in may -"Spring Bank Holiday" red on first monday in june -"Summer Bank Holiday" red on first monday in august -"October Bank Holiday" red on last monday in october -"Christmas Day" red on 12/25 -"St Stephens Day" red on 12/26 diff --git a/kholidays/holidays/holiday_il b/kholidays/holidays/holiday_il deleted file mode 100644 index 11243724e..000000000 --- a/kholidays/holidays/holiday_il +++ /dev/null @@ -1,72 +0,0 @@ -: -: Israeli holidays file for Korganizer -: Author: Jonathan Singer (jsinger@leeta.net), 13/01/02 -: Author: Lior Chen , 21/03/01 -: -: (Note that these holidays are only relevant for the current year). -: - -small "Fast: 10th of Tevet" on 5.1.01 -small "Tu BiShvat" on 8.02.01 -small "Fast: Ester" on 8.03.01 -small "Purim" on 9.3.01 -small "Passover" on 8.4.01 -small "Chol Hamoed" on 9.4.01 length 5 -small "2nd Passover" on 14.4.01 -small "Holocaust Rememberance day" on 19.4.01 -small "Memorial day for the IDF Soldiers" on 25.4.01 -small "Independence day" on 26.4.01 -small "Lag BaOmer" on 11.5.01 -small "Jerusalem day" on 21.5.01 -small "Shavuot" on 28.5.01 -small "Fast: 17th of Tamuz" on 08.07.01 -small "Fast: 9th of Av" on 29.07.01 -small "Rosh Hashana" on 18.9.01 length 2 -small "Fast: Gdalya" on 20.9.01 -small "Yom Kippur" on 27.9.01 -small "Succot" on 2.10.01 -small "Chol Hamoed Succot" on 3.10.01 length 6 -small "Simchat Torah" on 9.10.01 - -small "Tu B'Shvat" on 28.01.02 -small "Fast: Esther" on 25.2.02 -small "Purim" on 26.2.02 -small "Passover" on 28.3.02 -small "Chol Hamoed" on 29.3.02 length 5 -small "2nd Passover" on 3.4.02 -small "Holocaust Remembrance day" on 9.4.02 -small "Memorial day for the IDF Soldiers" on 16.4.02 -small "Independence Day" on 17.4.02 -small "Lag BaOmer" on 30.4.02 -small "Jerusalem Day" on 10.5.02 -small "Shavuot" on 17.5.02 -small "Fast: 17th of Tamuz" on 27.6.02 -small "Fast: 9th of Av" on 18.07.02 -small "Rosh Hashana" on 7.9.02 length 2 -small "Fast: Gedalia" on 9.9.02 -small "Yom Kippur" on 16.9.02 -small "Succot" on 21.9.02 -small "Chol Hamoed Succot" on 22.9.02 length 6 -small "Simchat Torah" on 28.9.02 -small "Fast: 10th of Tevet" on 15.12.02 - -small "Tu B'Shvat" on 18.01.03 -small "Fast: Esther" on 17.03.03 -small "Purim" on 18.3.03 -small "Passover" on 17.4.03 -small "Chol Hamoed" on 18.4.03 length 5 -small "2nd Passover" on 23.4.03 -small "Holocaust Remembrance day" on 29.4.03 -small "Memorial day for the IDF Soldiers" on 6.5.03 -small "Independence Day" on 7.5.03 -small "Lag BaOmer" on 20.5.03 -small "Jerusalem Day" on 30.5.03 -small "Shavuot" on 6.6.03 -small "Fast: 17th of Tamuz" on 17.07.03 -small "Fast: 9th of Av" on 7.08.03 -small "Rosh Hashana" on 27.9.03 length 2 -small "Fast: Gedalia" on 29.9.03 -small "Yom Kippur" on 6.10.03 -small "Succot" on 11.10.03 -small "Chol Hamoed Succot" on 12.10.03 length 6 -small "Simchat Torah" on 18.10.03 diff --git a/kholidays/holidays/holiday_is b/kholidays/holidays/holiday_is deleted file mode 100644 index a8312c612..000000000 --- a/kholidays/holidays/holiday_is +++ /dev/null @@ -1,60 +0,0 @@ -: -: ICELAND holiday file. Copy to ~/.holiday -: -: Author: Thorarinn R. Einarsson -: -: Last updated on Feb. 3, 1999, by TRE. -: -: Special Icelandic dates -: -small blue "Fullveldisdagurinn" weekend on december 1 -small blue "Lýðveldisdagurinn" weekend on june 17 -small blue "Sumardagurinn fyrsti" weekend on thursday after april 18 -small blue "Frídagur verslunarmanna" weekend on monday after july 31 -small blue "Frídagur verkamanna" weekend on may 1 -small "Sjómannadagurinn" on sunday after may 31 -small "Jónsmessa" on june 24 -small "Hundadagar byrja" on july 13 -small "Hundadagar enda" on august 23 - -: USA and World dates -small "Þakkargjörðardagurinn (BNA)" on fourth thursday in november -small "Alþjóðlegi ljóðadagurinn" on october 15 -small "Dagur Sameinuðu Þjóðanna" on october 24 -small "Halloween" on october 31 -small "Wright bræðra dagur" on december 17 -small "Valentínusardagur" on february 14 -small "St. Patrick dagur" on march 17 - -: Christmas -small "1. í Aðventu" weekend on sunday before december 25 minus 21 -small "2. í Aðventu" weekend on sunday before december 25 minus 14 -small "3. í Aðventu" weekend on sunday before december 25 minus 7 -small "4. í Aðventu" weekend on sunday before december 25 -small "Þorláksmessa" on december 23 -small blue "Aðfangadagur" weekend on december 24 -small blue "Jóladagur" weekend on december 25 -small blue "Annar í jólum" weekend on december 26 -small blue "Gamlársdagur" weekend on december 31 -small blue "Nýjársdagur" weekend on january 1 - -: Easter related -small "Pálmasunnudagur" weekend on easter minus 7 days -small "Skírdagur" weekend on easter minus 3 days -small "Föstudagurinn langi" weekend on easter minus 2 days -small "Páskadagur" weekend on easter -small "Annar í Páskum" weekend on easter plus 1 day -small "Bolludagur" on easter minus 48 days -small "Sprengidagur" on easter minus 47 days -small "Öskudagur" on easter minus 46 days -small "Hvítasunna" weekend on easter plus 49 days - -:small "Uppstigningardagur" on easter plus 40 days -:small "Trinity" on easter plus 46 day -:small "Corpus Christi" on easter plus 53 days - -: Seasons -small "Vorjafndægur" on march 22 -small "Sumar sólstöður" on june 22 -small "Haustjafndægur" on september 22 -small "Vetrarsólstöður" on december 22 diff --git a/kholidays/holidays/holiday_it b/kholidays/holidays/holiday_it deleted file mode 100644 index 2428122a4..000000000 --- a/kholidays/holidays/holiday_it +++ /dev/null @@ -1,64 +0,0 @@ -: -: Italian holiday file. -: by Riccardo Scateni (riccardo@crs4.it) -: Updated and maintained by the Italian l10n team (kde-i18n-it@kde.org) -: -: "weekend" or "red" indicate a "proper" holiday (i.e. you do not work) -: Other colours (black, green, yellow, blue, magenta, cyan, white) -: can be used to distinguish between minor anniversaries or not-so-real -: holidays, when you go working anyway. -: "small" holidays are not as "invasive" in the month view in KOrganizer, -: and do not take as much space. - -: Religious holidays (default color for non-weekends: black) - -weekend "Epifania" on 6.1 -small black "San Giuseppe" on 19.3 -small black "Giovedì Grasso" on easter minus 52 days -small black "Martedì Grasso" on easter minus 47 days -small black "Mercoledì delle Ceneri" on easter minus 46 days -small black "Prima di Quaresima" on easter minus 42 days -small black "Seconda di Quaresima" on easter minus 35 days -small black "Terza di Quaresima" on easter minus 28 days -small black "Quarta di Quaresima" on easter minus 21 days -small black "Quinta di Quaresima" on easter minus 14 days -small black "Domenica delle Palme" on easter minus 7 days -weekend "Pasqua" on easter -weekend "Lunedì dell'Angelo" on easter plus 1 day -small black "Ascensione" on easter plus 42 days -small black "Pentecoste" on easter plus 49 days -small black "Santissima Trinità" on easter plus 56 days -small black "Corpus Domini" on easter plus 63 days -small black "Sacro Cuore di Gesù" on easter plus 68 days -small black "Santi Pietro e Paolo" on 29.6 -small black "San Francesco" on 4.10 -weekend "Ognissanti" on 1.11 -small black "Defunti" on 2.11 -weekend "Immacolata Concezione" on 8.12 -small black "Prima d'avvento" on sunday before 24 december minus 21 days -small black "Seconda d'avvento" on sunday before 24 december minus 14 days -small black "Terza d'avvento" on sunday before 24 december minus 7 days -small black "Quarta d'avvento" on sunday before 24 december -weekend "Natale" on 25.12 -weekend "Santo Stefano" on 26.12 -small black "San Silvestro" on 31.12 - -: Lay holidays: 1.1 and 15.8 are also religious holidays. -: (default color for non-weekends: green) - -weekend "Capodanno" on 1.1 -small green "Giornata della Memoria" on 27.1 -small green "Giornata del Ricordo" on 10.2 -small green "Festa della donna" on 8.3 -weekend "Anniversario della Liberazione" on 25.4 -weekend "Festa del Lavoro" on 1.5 -weekend "Festa della Repubblica" on 2.6 -weekend "Ferragosto" on 15.8 -small green "Festa dell'Unità nazionale" on 4.11 - - -: Daylight savings (blue) - -blue "Passaggio all'ora legale" on last sunday in march -blue "Passaggio all'ora solare" on last sunday in october - diff --git a/kholidays/holidays/holiday_jm b/kholidays/holidays/holiday_jm deleted file mode 100644 index 41f66aed4..000000000 --- a/kholidays/holidays/holiday_jm +++ /dev/null @@ -1,19 +0,0 @@ -: -: Jamaican holiday file. Copy to ~/.holiday -: -: Author: Roger Pixley -: -small "New Year's Day" weekend on january 1 -small "Valentine's Day" on february 14 -small "Ash Wednesday" weekend on february 25 -small "Good Friday" weekend on easter minus 2 days -small "Easter" weekend on easter -small "Easter Monday" weekend on easter plus 1 day -small "Mother's Day" on second sunday in may -small "Labour Day" weekend on may 23 -small "Father's Day" on third sunday in june -small "Emancipation Day" weekend on august 1 -small "Independence Day" weekend on august 6 -small "National Heroes Day" weekend on third monday in october -small "Christmas" weekend on december 25 -small "Boxing Day" weekend on december 26 diff --git a/kholidays/holidays/holiday_jp b/kholidays/holidays/holiday_jp deleted file mode 100644 index eadb6da2c..000000000 --- a/kholidays/holidays/holiday_jp +++ /dev/null @@ -1,80 +0,0 @@ -: -: Japanese holiday file. Copy to ~/.holiday -: Author: Toyohiro Asukai -: Last modified on Nov 16 2004 -: -: National Holidays. (English Messages) -:small "New Year's Day" weekend on 1/1 -:small "Coming of Age" weekend on second monday in january -:small "National Foundation Day" weekend on 2/11 -:small "Vernal Equinox Day" weekend on 3/20/2005 -:small "Vernal Equinox Day" weekend on 3/21/2006 -:small "Vernal Equinox Day" weekend on 3/21/2007 -:small "Vernal Equinox Day" weekend on 3/20/2008 -:small "Vernal Equinox Day" weekend on 3/20/2009 -:small "Vernal Equinox Day" weekend on 3/21/2010 -:small "Greenery Day" weekend on 4/29 -:small "Constitution Day" weekend on 5/3 -:small "Holiday" weekend on 5/4 -:small "Children's Day" weekend on 5/5 -:small "Oceans' Day" weekend on third monday in july -:small "Respect for Senior Citizens Day" weekend on third monday in september -:small "Autumnal Equinox Day" weekend on 9/23 -:small "Sports Day" weekend on second monday in october -:small "Culture Day" weekend on 11/3 -:small "Labor Thanksgiving Day" weekend on 11/23 -:small "The Emperor's Birthday" weekend on 12/23 - -: National Holidays. (Japanese and English messages) -small "元旦(New Year's Day)" weekend on 1/1 -small "成人の日(Coming of Age)" weekend on second monday in january -small "建国記念日(National Foundation Day)" weekend on 2/11 -small "春分の日(Vernal Equinox Day)" weekend on 3/20/2005 -small "春分の日(Vernal Equinox Day)" weekend on 3/21/2006 -small "春分の日(Vernal Equinox Day)" weekend on 3/21/2007 -small "春分の日(Vernal Equinox Day)" weekend on 3/20/2008 -small "春分の日(Vernal Equinox Day)" weekend on 3/20/2009 -small "春分の日(Vernal Equinox Day)" weekend on 3/21/2010 -small "みどりの日(Greenery Day)" weekend on 4/29 -small "憲法記念日(Constitution Day)" weekend on 5/3 -small "休日(Holiday)" weekend on 5/4 -small "こどもの日(Children's Day)" weekend on 5/5 -small "海の日(Oceans' Day)" weekend on third monday in july -small "敬老の日(Respect for Senior Citizens Day)" weekend on third monday in september -small "秋分の日(Autumnal Equinox Day)" weekend on 9/23 -small "体育の日(Sports Day)" weekend on second monday in october -small "文化の日(Culture Day)" weekend on 11/3 -small "勤労感謝の日(Labor Thanksgiving Day)" weekend on 11/23 -small "天皇誕生日(The Emperor's Birthday)" weekend on 12/23 - -: If a "National Holiday" is on Sunday,the following day -: shall be a substitute holiday. -:small "Substitute holiday" weekend on 3/21/2005 -:small "Substitute holiday" weekend on 1/2/2006 -:small "Substitute holiday" weekend on 2/12/2007 -:small "Substitute holiday" weekend on 4/30/2007 -:small "Substitute holiday" weekend on 9/24/2007 -:small "Substitute holiday" weekend on 12/24/2007 -:small "Substitute holiday" weekend on 11/24/2008 -:small "Substitute holiday" weekend on 3/22/2010 - -small "振替休日(Substitute holiday)" weekend on 3/21/2005 -small "振替休日(Substitute holiday)" weekend on 1/2/2006 -small "振替休日(Substitute holiday)" weekend on 2/12/2007 -small "振替休日(Substitute holiday)" weekend on 4/30/2007 -small "振替休日(Substitute holiday)" weekend on 9/24/2007 -small "振替休日(Substitute holiday)" weekend on 12/24/2007 -small "振替休日(Substitute holiday)" weekend on 11/24/2008 -small "振替休日(Substitute holiday)" weekend on 3/22/2010 - - -: Japanese Events , not National Holidays. -:small "St. Valentine's Day" on february 14 -:small "Girls' Festival" on march 3 -:small "Buddha's Birthday" on april 8 -:small "May Day" on may 1 -:small "Boys' Festival" on may 5 -:small "Mother's Day" on second sunday in may -:small "Father's Day" on third sunday in june -:small "Festival of the Weaver Star" on july 7 -:small "Christmas" on december 25 diff --git a/kholidays/holidays/holiday_lt b/kholidays/holidays/holiday_lt deleted file mode 100644 index 14f41c1c4..000000000 --- a/kholidays/holidays/holiday_lt +++ /dev/null @@ -1,42 +0,0 @@ -: -: Lithuanian holiday file. Copy to ~/.holiday -: -: Author: Donatas Glodenis -: 12 July 2005 (first version) -: -: Valstybinės šventės / National holidays -: based on the Work Code of the Republic of Lithuania, article no. 162. -: List accessible at http://lt.wikipedia.org/wiki/Lietuvos_%C5%A1vent%C4%97s - -small red "Naujieji metai" weekend on 1/1 -small red "Lietuvos valstybės atkūrimo diena" weekend on 2/16 -small red "Lietuvos nepriklausomybės atkūrimo diena" weekend on 3/11 -small red "Velykos" weekend on easter length 2 days -small red "Tarptautinė darbo diena" weekend on 5/1 -small red "Motinos diena" on first sunday in may -small red "Rasos (Joninės)" weekend on 6/24 -small red "Valstybės (Lietuvos karaliaus Mindaugo karūnavimo) diena" weekend on 7/6 -small red "Žolinė (Švč. Mergelės Marijos ėmimo į dangų diena)" weekend on 8/15 -small red "Visų Šventųjų diena" weekend on 11/1 -small red "Kalėdos" weekend on 12/25 length 2 days - -: Tautinės bei religinės šventės / folk (green) and religious (cyan) holidays -: NOT public holidays -: Sources various -small cyan "Trys karaliai" cyan on 1/6 -small green "Šv. Valentino diena" green on 2/14 -small green "Užgavėnės" green on easter minus 47 days -small cyan "Pelenų diena" cyan on easter minus 46 days -small green "Melagio diena" green on 4/1 -small cyan "Verbų sekmadienis" weekend on easter minus 7 days -small cyan "Didysis penktadienis" cyan on easter minus 2 days -small cyan "Sekminės" weekend on easter plus 49 days -small cyan "Kūčios" cyan on 12/24 - -: Religiniai sezonai / Religious holiday seasons -: next is Lent season: -: small white "Gavėnia" white on easter minus 45 days length 44 days - -: next is advent season -: small white "Adventas" 11/28 length 27 days - diff --git a/kholidays/holidays/holiday_mx b/kholidays/holidays/holiday_mx deleted file mode 100644 index c20c561e9..000000000 --- a/kholidays/holidays/holiday_mx +++ /dev/null @@ -1,32 +0,0 @@ -: -: Mexican holiday file -: -: Author: edscott - -small "Año Nuevo" weekend on 1/1 -small "Batalla de Puebla" on may 5 -small "Día de la Revolución" on november 20 -small "Día de los Santos Inocentes" on december 28 -small "Día de Vírgen de Guadalupe" on december 12 -small "Día de la Raza" on october 12 -small "Navidad" on december 25 -small "Día de los Reyes" on january 6 -small "Natalicio de Benito Juárez" on march 21 -small "Día de la expropiación petrolera" on march 18 -small "Día del trabajo" on may 1 -small "Día de la Independencia" on september 16 -small "Domingo de Pascua" on easter -small "Sábado de Gloria" on easter minus 1 -small "Viérnes Santo" on easter minus 2 -small "Jueves Santo" on easter minus 3 -small "Día de Todos los Santos" on november 1 -small "Día de los Fieles Difuntos" on november 2 -small "Día de la Constitución" on february 5 -small "Día de la Madre" on may 10 - -: Seasons -"Equinoxio de primavera" on march 21 -"Solsticio de verano" on june 21 -"Equinoxio de otoño" on september 21 -"Solsticio de invierno" on december 21 - diff --git a/kholidays/holidays/holiday_nl b/kholidays/holidays/holiday_nl deleted file mode 100644 index 23df998e7..000000000 --- a/kholidays/holidays/holiday_nl +++ /dev/null @@ -1,72 +0,0 @@ -: -: Dutch holiday file. Copy to ~/.holiday -: -: NOTE: Goede Vrijdag and Bevrijdingsdag are not holidays for -: everybody, therefore I don't put them in the "weekend" color. -: Government employees usually have these days off, for other -: categories it varies. Check with your employer! -: -: Also note that if Koninginnedag falls on a Sunday, the official day -: off is moved to Monday. -: -: Author: Guido van Rossum, CWI, Amsterdam -: -small "Nieuwjaar" weekend on 1.1. -small "Pasen" weekend on easter length 2 days -small "Hemelvaart" weekend on easter plus 39 days -small "Pinksteren" weekend on easter plus 49 days length 2 days -small "Koninginnedag" weekend on 30.4. -small "Bevrijdingsdag" on 5.5. -small "Kerstmis" weekend on 25.12. length 2 days -: -: Andere feestdagen: -: Author: Jeroen C. Kessels -: -small "Driekoningen" on 6.1 -small "Vastenavond" on easter minus 47 days -small "Aswoensdag" on easter minus 46 days -small "Palmzondag" on easter minus 7 days -small "Witte Donderdag" on easter minus 3 days -small "Goede Vrijdag" on easter minus 2 days -small "Dodenherdenking" on 4.5 -small "Bevrijdingsdag" on 5.5 -small "Dierendag" on 4.10 -small "Allerheiligen" on 1.11 -small "Allerzielen" on 2.11 -small "Oudjaar" on 31.12 -small "Moederdag" on every second sunday in may -small "Vaderdag" on every third sunday in june -: -: Winter- en zomertijd: -: Author: Wilbert Berendsen -: -blue "Zomertijd" on last sunday in march -blue "Wintertijd" on last sunday in october -: -: Dagen in het kerkelijk jaar -: Author: Wilbert Berendsen -: -: Kopieer dit bestand eventueel onder een andere naam, maar beginnend -: met 'holiday_' naar ~/.kde/share/apps/korganizer/ en haal op de -: volgende regels de dubbelepunten weg. -:small "Eerste advent" on sunday before 3.12 -:small "Tweede advent" on sunday before 10.12 -:small "Derde advent (Gaudete)" on sunday before 17.12 -:small "Vierde advent (Rorate)" on sunday before 24.12 -:small "Septuagesima (zeventigste)" on easter minus 63 days -:small "Sexagesima (zestigste)" on easter minus 56 days -:small "Quinquagesima (vijftigste)" on easter minus 49 days -:small "Invocabit (roept Hij mij aan, begin Veertigdagentijd)" on easter minus 42 days -:small "Reminiscere (gedenk)" on easter minus 35 days -:small "Oculi (ogen)" on easter minus 28 days -:small "Laetare (verheugt u)" on easter minus 21 days -:small "Judica (doe recht)" on easter minus 14 days -:small "Quasi modo geniti (als pasgeboren kinderen)" on easter plus 7 days -:small "Misericordias Domini (trouw van de Heer)" on easter plus 14 days -:small "Jubilate (juicht)" on easter plus 21 days -:small "Cantate (zingt)" on easter plus 28 days -:small "Rogate (bidt)" on easter plus 35 days -:small "Exaudi (hoor)" on easter plus 42 days -:small "Trinitatis (drie-eenheid)" on easter plus 56 days -:small "Hervormingsdag" on 31.10 -:small "Laatste zondag kerkelijk jaar" on sunday before 26.11 diff --git a/kholidays/holidays/holiday_no b/kholidays/holidays/holiday_no deleted file mode 100644 index 5405ca2ae..000000000 --- a/kholidays/holidays/holiday_no +++ /dev/null @@ -1,72 +0,0 @@ -: -: Holiday file for Norway, written in Norwegian Bokmål. -: Original version by geiri@stud.cs.uit.no. -: Corrected, reorganized and expanded version by -: Karl Ove Hufthammer . -: -: Offisielle helligdager -weekend "Nyttårsdag" weekend on 1.1 -weekend "Palmesøndag" weekend on easter minus 7 -weekend "Skjærtorsdag" weekend on easter minus 3 -weekend "Langfredag" weekend on easter minus 2 -weekend "Første påskedag" weekend on easter -weekend "Andre påskedag" weekend on easter plus 1 -weekend "Arbeidernes internasjonale kampdag" weekend on 1.5 -weekend "Grunnlovsdagen" weekend on 17.5 -weekend "Kristi himmelfartsdag" weekend on easter plus 39 days -weekend "Første pinsedag" weekend on easter plus 49 days -weekend "Andre pinsedag" weekend on easter plus 50 days -weekend "Første juledag" weekend on 25.12 -weekend "Andre juledag" weekend on 26.12 - -: Påske og pinse -"Fastelavnssøndag" on easter minus 49 -"Fetetirsdag" on easter minus 47 -"Askeonsdag" on easter minus 46 -"Påskeaften" on easter minus 1 -"Pinseaften" on easter plus 48 days -"Bots- og bededag" on last sunday in october - -: Sommer- og vintertid -"Sommertid starter" on last sunday in march -"Vintertid starter" on last sunday in october - -: Mors- og farsdag -"Morsdag" on second sunday in february -"Farsdag" on second sunday in november - -: Jul -"Første søndag i advent" on sunday before 24.12 minus 21 days -"Andre søndag i advent" on sunday before 24.12 minus 14 days -"Tredje søndag i advent" on sunday before 24.12 minus 7 days -"Fjerde søndag i advent" on sunday before 24.12 -"Luciadagen" on 13.12 -"Lille julaften" on 23.12 -"Julaften" on 24.12 - -: Nyttår -"Nyttårsaften" on 31.12 - -: Offisielle flaggdager som ikke er høytidssager -"H.K.H. Prinsesse Ingrid Alexandras fødselsdag" on 21.1 -"Samefolkets dag" on 6.2 -"H.M. Kong Harald Vs fødselsdag" on 21.2 -"Frigjøringsdagen 1945" on 8.5 -"H.M. Dronning Sonjas fødselsdag" on 4.7 -"H.K.H. Kronprins Haakon Magnus’ fødselsdag" on 20.7 -"Olsokdagen" on 29.7 -"H.K.H. Kronprinsesse Mette-Marits fødselsdag " on 19.8 - -: Andre -"Valentinsdagen" on 14.2 -"Skuddårsdagen" on 29.2 -"Den internasjonale kvinnedagen" on 8.3 -"Aprilsnarr" on 1.4 -"Unionsoppløsningen 1905" on 7.6 -"Sankthansaften" on 23.6 -"Sankthansdagen" on 24.6 -"Mikkelsmesse" on 29.9 -"FN-dagen" on 24.10 -"Allehelgensaften" on 31.10 -"Allehelgensdag" on first sunday in november - diff --git a/kholidays/holidays/holiday_nz b/kholidays/holidays/holiday_nz deleted file mode 100644 index 9e82bd696..000000000 --- a/kholidays/holidays/holiday_nz +++ /dev/null @@ -1,99 +0,0 @@ -: -: New Zealand holiday file. Copy to ~/.holiday -: -: Author: Miles Leonard-Taylor (m.leonardtaylor@irl.cri.nz) -: 13 September 2000 (first version) -: 24 September 2004 (update with spelling corrections) -: 11 February 2008 (change to daylight-savings rules by government) -: Thanks to various people for pointing out all my spelling mistakes... - -: Holidays as defined by the government's "Holidays Acts, 1981-1991" -: and the Visits and Ceremonial office of the Department of Internal Affairs -: and was also at http://www.nzir.dol.govt.nz/rights/leave/dates/2000.html -: but now located under http://www.ers.dol.govt.nz/holidays_act_2003/dates/ - -small "Christmas" weekend on december 25 -small "Boxing Day" weekend on december 26 -small "New Year's Day" weekend on january 1 -small "" weekend on january 2 -: -small "Good Friday" weekend on easter minus 2 days -small "Easter Sunday" weekend on easter -small "Easter Monday" weekend on easter plus 1 days -: -small "Waitangi Day" weekend on february 6 -small "Anzac Day" weekend on april 25 -small "Queen's Birthday" weekend on first monday in june -small "Labour Day" weekend on fourth monday in october - -: Other useful dates, but NOT public holidays, sources unknown -small "St. Valentine's Day" on february 14 -small "St. Patrick's Day" on march 17 -small "Mother's Day" on second sunday in may -small "Father's Day" on first sunday in september -small "Halloween" on october 31 -small "Guy Fawkes" on november 5 -small "Melbourne Cup" on first tuesday in november - -: Daylight Savings Reminders, defined by Internal Affairs -: see http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Services-Daylight-Saving-Index?OpenDocument -small "Clocks Forward" on last sunday in september -small "Clocks Back" on first sunday in april - -: Additional Easter dates and other Solemneties, defined by Catholic Church -:small "Epiphany on sunday after january 2 -:small "Baptism of Lord" on sunday after january 2 plus 7 days -:small "Presentation" on february 2 -small "Ash Wednesday" on easter minus 46 days -:small "Palm Sunday" on easter minus 7 days -small "Ascension" on easter plus 42 days -small "Pentecost" weekend on easter plus 49 days -small "Trinity" on easter plus 56 days -small "Corpus Christi" on easter plus 63 days -:small "Sacred Heart" on easter plus 68 days -:small "John the Baptist" on june 24 -:small "Sts Peter & Paul" on june 29 -:small "Transfiguration" on august 6 -small "Assumption" on august 15 -small "All Saints" on november 1 -:small "All Souls" on november 2 -:small "Christ the King" on sunday before 24.12 minus 28 days -:small "1. Advent" on sunday before 24.12 minus 21 days -:small "2. Advent" on sunday before 24.12 minus 14 days -:small "3. Advent" on sunday before 24.12 minus 7 days -:small "4. Advent" on sunday before 24.12 -:small "Holy Family" on first sunday after december 26 - -: Regional Anniversaries -: Defined at http://www.nzir.dol.govt.nz/rights/leave/dates/2000.html -: A map may be viewed at http://www.govt.nz/localgov/regionalmap.php3 -: These may not be tagged as holdiays ("weekend") as they are regional -: NB. "on monday after 19.1" means monday _ON_ _OR_ after 19.1 (inclusive) -: -: Region Offical Date How it shifts around each year -: -: Auckland 29 January Moves to nearest monday -small "Auckland Day" on monday after 26 january -: Taranaki 31 March Moves to 2nd Mon in Mar to miss easter -small "Taranaki Day" on second monday in march -: Hawkes' Bay 1 November Moves to Friday before Labour day -small "Hawkes Bay Day" on fourth monday in october minus 3 days -: Wellington 22 January Moves to nearest monday -small "Wellington Day" on monday after 19 january -: Marlborough 1 November Moves to first monday after Labour day -small "Marlborough Day" on fourth monday in october plus 7 days -: Nelson 1 February Moves to nearest monday -small "Nelson Day" on monday after 29 january -: Canterbury 16 December Moves to 2nd Fri after 1st Tues in Nov -small "Canterbury Day" on friday after 11 november -: Canterbury (South) 16 December Moves to 4th monday in september -small "S.Canterbury Day" on fourth monday in september -: Westland 1 December Moves to nearest monday -small "Westland Day" on monday after 28 november -: Otago 23 March Moves to nearest monday -small "Otago Day" on monday after 20 march -: Southland 17 January Moves to nearest monday -small "Southland Day" on monday after 14 march -: Chatham Islands 30 November Moves to nearest monday -small "Chatham's Day" on monday after 27 november - diff --git a/kholidays/holidays/holiday_pl b/kholidays/holidays/holiday_pl deleted file mode 100644 index 7db3a4bd6..000000000 --- a/kholidays/holidays/holiday_pl +++ /dev/null @@ -1,41 +0,0 @@ -: Polish holidays file ( take one ) -: sob kwi 10 15:47:14 CEST 1999 -: by Krzysztof P. Jasiutowicz -: - -small "Nowy Rok" on 1.1. -small "Trzech Króli" weekend on 6.1. -: small "Śledzik" on easter minus 47 days -small "Popielec" on easter minus 46 days -small "Dzień Kobiet" on 8.3. -small "Wielki Piątek" weekend on easter minus 2 days -small "Wielkanoc" weekend on easter length 2 days -small "Lany Poniedziałek" weekend on easter plus 1 day -small "Niedziela Palmowa" on easter minus 7 days -small "Zielone Świątki" weekend on easter plus 49 days -small "Boże Ciało" on easter plus 60 days -small "Wniebowzięcie NMP" on 15.8 -small "Święto Pracy" on 1.5. -small "Dzień Flagi" on 2.5. -small "Święto Konstytucji" on 3.5. -small "Wszystkich Świętych" on 1.11. -small "Zaduszki" on 2.11. -small "Święto Niepodległości" on 11.11. -small "Wigilia" on 24.12. -small "Boże Narodzenie" on 25.12. length 2 days -small "Sylwester" on 31.12. - -small "Dzień Babci" weekend on 21.1. -small "Dzień Dziadka" weekend on 22.1. -small black "Andrzejki" on 30.11. -small black "Dzień Matki" on 26.5. -small black "Dzień Ojca" on 23.6. -small black "Dzień Dziecka" on 1.6. -small black "Św. Mikołaj" on 6.12. -small black "Walentynki" on 14.2. - - -"Początek wiosny" on march 21 -"Początek lata" on june 22 -"Początek jesieni" on september 23 -"Początek zimy" on december 22 diff --git a/kholidays/holidays/holiday_pt b/kholidays/holidays/holiday_pt deleted file mode 100644 index 2f567e5a1..000000000 --- a/kholidays/holidays/holiday_pt +++ /dev/null @@ -1,349 +0,0 @@ -: -: Portugal holiday file. Copy to ~/.holiday -: -: Author: moitinho@civil.ist.utl.pt -: -: Informação legal em: http://www.infocid.pt/infocid/0_116.htm -: -: Feriados obrigatórios -: -"Ano Novo" on january 1 -"6ª feira santa" on easter minus 2 days -"25 de Abril" on april 25 -"1º de Maio" on may 1 -"Corpo de Deus" on easter plus 60 days -"10 de Junho" on june 10 -"Assunção" on august 15 -"República" on october 5 -"Todos os Santos" on november 1 -"Restauração" on december 1 -"Nª Senhora Conceição" on december 8 -"Natal" on december 25 -: -: Datas relacionadas com a Páscoa -: -"Carnaval" on easter minus 50 days length 4 days -"4ª feira de cinzas" on easter minus 46 days -"Páscoa" on easter -"Pentecostes" weekend on easter plus 49 days -:"Ascension" on easter plus 40 days -:"Trinity" on easter plus 46 days -: -: Estações -: -"Primavera" on march 22 -"Verão" on june 22 -"Outono" on september 22 -"Inverno" on december 22 -: -: Feriados municipais -: http://www.viautarquica.pt/autarnet/feriados.htm -: -: Desmarcar aqueles que considerar relevantes -: -: "Abrantes" on june 14 -: "Águeda" on 1.ª easter plus 50 days -: "Aguiar da Beira" on june 24 -: "Alandroal" on easter plus 8 days -: "Albergaria-a-Velha" on third sunday in august plus 1 day -: "Albufeira" on august 20 -: "Alcácer do Sal" on june 24 -: "Alcanena" on easter plus 40 days -: "Alcobaça" on august 20 -: "Alcochete" on june 24 -: "Alcoutim" on second friday in september -: "Alenquer" on easter plus 40 days -: "Alfândega da Fé" on june 29 -: "Alijó" on november 11 -: "Aljezur" on august 29 -: "Aljustrel" on june 13 -: "Almada" on june 24 -: "Almeida" on july 2 -: "Almeirim" on easter plus 40 days -: "Almodôvar" on april 17 -: "Alpiarça" on april 2 -: "Alter do Chão" on easter plus 40 days -: "Alvaiázere" on june 13 -: "Alvito" on easter plus 40 days -: "Amadora" on september 11 -: "Amarante" on july 8 -: "Amares" on june 13 -: "Anadia" on easter plus 40 days -: "Angra do Heroísmo" on june 24 -: "Ansião" on easter plus 40 days -: "Arcos de Valdevez" on july 11 -: "Arganil" on september 7 -: "Armamar" on june 24 -: "Arouca" on may 2 -: "Arraiolos" on easter plus 40 days -: "Arronches" on june 24 -: "Arruda dos Vinhos" on easter plus 40 days -: "Aveiro" on may 12 -: "Avis" on easter plus 1 day -: "Azambuja" on easter plus 40 days -: "Baião" on august 24 -: "Barcelos" on may 3 -: "Barrancos" on august 28 -: "Barreiro" on june 28 -: "Batalha" on august 14 -: "Beja" on easter plus 40 days -: "Belmonte" on april 26 -: "Benavente" on easter plus 40 days -: "Bombarral" on june 29 -: "Borba" on easter plus 1 day -: "Boticas" on november 6 -: "Braga" on june 24 -: "Bragança" on august 22 -: "Cabeceiras de Basto" on september 29 -: "Cadaval" on january 13 -: "Caldas da Rainha" on may 15 -: "Caminha" on easter plus 1 day -: "Calheta (Açores)" on june 24 -: "Calheta (Madeira)" on november 25 -: "Câmara de Lobos" on october 16 -: "Campo Maior" on easter plus 1 day -: "Cantanhede" on july 25 -: "Carrazeda de Ansiães" on last friday in august -: "Carregal do Sal" on third monday in july -: "Cartaxo" on easter plus 40 days -: "Cascais" on june 13 -: "Castanheira de Pêra" on july 4 -: "Castelo Branco" on easter plus 16 days -: "Castelo de Paiva" on june 24 -: "Castelo de Vide" on easter plus 1 day -: "Castro Daire" on june 29 -: "Castro Marim" on june 24 -: "Castro Verde" on june 29 -: "Celorico da Beira" on may 23 -: "Celorico de Basto" on july 25 -: "Chamusca" on easter plus 40 days -: "Chaves" on july 8 -: "Cinfães" on june 24 -: "Coimbra" on july 4 -: "Condeixa-a-Nova" on july 24 -: "Constância" on easter plus 1 day -: "Coruche" on august 17 -: "Corvo" on june 20 -: "Covilhã" on october 20 -: "Crato" on easter plus 1 day -: "Cuba" on easter plus 1 day -: "Elvas" on january 14 -: "Entroncamento" on november 24 -: "Espinho" on june 16 -: "Esposende" on august 19 -: "Estarreja" on june 13 -: "Estremoz" on easter plus 40 days -: "Évora" on june 29 -: "Fafe" on may 16 -: "Faro" on september 7 -: "Felgueiras" on june 29 -: "Ferreira do Alentejo" on march 5 -: "Ferreira do Zêzere" on june 13 -: "Figueira de Castelo Rodrigo" on july 7 -: "Figueira da Foz" on june 24 -: "Figueiró dos Vinhos" on june 24 -: "Fornos de Algodres" on september 29 -: "Freixo de Espada à Cinta" on easter plus 1 day -: "Fronteira" on april 6 -: "Funchal" on august 21 -: "Fundão" on september 15 -: "Gavião" on november 23 -: "Góis" on last tuesday in july -: "Golegã" on easter plus 40 days -: "Gondomar" on first sunday in october plus 1 day -: "Gouveia" on second sunday in august plus 1 day -: "Grândola" on october 22 -: "Guarda" on november 26 -: "Guimarães" on june 24 -: "Horta" on june 24 -: "Idanha-a-Nova" on easter plus 15 days -: "Ílhavo" on easter plus 1 day -: : .... "Lajes das Flores" on segunda-feira após o 3. fim de semana de Julho ?? -: "Lajes das Flores" on third sunday in july plus 1 day -: "Lajes do Pico" on june 29 -: "Lagoa (Açores)" on april 11 -: "Lagoa (Algarve)" on september 8 -: "Lagos" on october 27 -: "Lamego" on september 8 -: "Leiria" on may 22 -: "Lisboa" on june 13 -: "Loulé" on easter plus 40 days -: "Loures" on june 26 -: "Lourinhã" on june 24 -: "Lousã" on june 24 -: "Lousada" on last monday in july -: "Mação" on easter plus 1 day -: "Macedo de Cavaleiros" on june 29 -: "Machico" on october 9 -: "Madalena" on july 22 -: "Mafra" on easter plus 40 days -: "Maia" on second sunday in july plus 1 day -: "Mangualde" on september 8 -: "Manteigas" on march 4 -: "Marco de Canaveses" on september 8 -: "Marinha Grande" on easter plus 40 days -: "Marvão" on september 8 -: "Matosinhos" on easter plus 51 days -: "Mealhada" on easter plus 40 days -: "Meda" on november 11 -: "Melgaço" on easter plus 40 days -: "Mértola" on june 24 -: "Mesão Frio" on november 30 -: "Mira" on june 25 -: "Miranda do Corvo" on june 1 -: "Miranda do Douro" on july 10 -: "Mirandela" on may 25 -: "Mogadouro" on october 15 -: "Moimenta da Beira" on june 24 -: "Moita" on second sunday in september plus 2 days -: "Monção" on easter plus 60 days -: "Monchique" on easter plus 40 days -: "Mondim de Basto" on july 25 -: "Monforte" on easter plus 8 days -: "Montalegre" on june 9 -: "Montemor-o-Novo" on march 8 -: "Montemor-o-Velho" on september 8 -: "Montijo" on june 29 -: "Mora" on easter plus 1 day -: "Mortágua" on easter plus 40 days -: "Moura" on june 24 -: "Mourão" on february 2 -: "Murça" on may 8 -: "Murtosa" on september 8 -: "Nazaré" on september 8 -: "Nelas" on june 24 -: "Nisa" on easter plus 1 day -: "Nordeste" on july 18 -: "Óbidos" on january 11 -: "Odemira" on september 8 -: "Oeiras" on june 7 -: "Oleiros" on second sunday in august plus 1 day -: "Olhão" on june 16 -: "Oliveira de Azeméis" on second monday in august -: "Oliveira de Frades" on october 7 -: "Oliveira do Bairro" on easter plus 40 days -: "Oliveira do Hospital" on october 7 -: "Ourém" on june 20 -: "Ourique" on september 8 -: "Ovar" on july 25 -: "Paços de Ferreira" on november 6 -: "Palmela" on june 1 -: "Pampilhosa da Serra" on april 10 -: "Paredes de Coura" on august 10 -: "Paredes" on third sunday in july plus 1 day -: "Pedrógão Grande" on july 24 -: "Penacova" on july 17 -: "Penafiel" on november 11 -: "Penalva do Castelo" on august 25 -: "Penamacor" on easter plus 1 day -: "Penedono" on august 29 -: "Penela" on september 29 -: "Peniche" on first sunday in august plus 1 day -: "Peso da Régua" on august 16 -: "Pinhel" on august 25 -: "Pombal" on november 11 -: : .... "Ponta Delgada" on segunda-feira do Senhor Santo Cristo em Maio ??? -: "Ponta do Sol" on september 8 -: "Ponte da Barca" on august 24 -: "Ponte de Lima" on september 20 -: "Ponte de Sor" on easter plus 1 day -: "Portalegre" on may 23 -: "Portel" on easter plus 1 day -: "Portimão" on june 24 -: "Porto" on june 24 -: "Porto Moniz" on july 22 -: "Porto de Mós" on june 29 -: "Porto Santo" on june 24 -: "Póvoa do Varzim" on june 29 -: "Póvoa de Lanhoso" on march 19 -: "Povoação" on easter plus 61 days -: "Proença-a-Nova" on june 13 -: "Redondo" on easter plus 1 day -: "Reguengos de Monsaraz" on june 13 -: "Resende" on september 29 -: "Ribeira Brava" on june 29 -: "Ribeira Grande" on june 29 -: "Ribeira de Pena" on august 16 -: "Rio Maior" on november 6 -: "São Brás de Alportel" on june 1 -: "São João da Madeira" on october 11 -: "São João da Pesqueira" on june 24 -: "São Pedro do Sul" on june 29 -: "São Roque do Pico" on august 16 -: "Sabrosa" on september 8 -: "Sabugal" on easter plus 8 days -: "Salvaterra de Magos" on easter plus 40 days -: "Santa Comba Dão" on easter plus 40 days -: "Santa Cruz" on january 15 -: "Santa Cruz das Flores" on june 24 -: "Santa Cruz da Graciosa" on june 24 -: "Santa Maria da Feira" on january 20 -: "Santa Marta de Penaguião" on january 13 -: "Santana" on may 25 -: "Santarém" on march 19 -: "Santiago do Cacém" on july 25 -: "Santo Tirso" on july 11 -: "São Vicente" on january 22 -: "Sardoal" on september 22 -: "Sátão" on august 20 -: "Seia" on july 3 -: "Seixal" on july 29 -: "Sernancelhe" on may 3 -: "Serpa" on easter plus 2 days -: "Sertã" on june 24 -: "Sesimbra" on may 4 -: "Setúbal" on september 15 -: "Sever do Vouga" on sepetember 21 -: "Silves" on september 3 -: "Sines" on november 24 -: "Sintra" on june 29 -: "Sobral de Monte Agraço" on easter plus 40 days -: "Soure" on september 21 -: "Sousel" on easter plus 1 day -: "Tábua" on april 10 -: "Tabuaço" on june 24 -: "Tarouca" on september 29 -: "Tavira" on june 24 -: "Terras de Bouro" on june 24 -: "Tomar" on march 1 -: "Tondela" on september 16 -: "Torre de Moncorvo" on march 19 -: "Torres Novas" on easter plus 40 days -: "Torres Vedras" on november 11 -: "Trancoso" on may 29 -: "Vagos" on easter plus 50 days -: "Vale de Cambra" on june 13 -: "Valença" on september 18 -: "Valongo" on june 24 -: "Valpaços" on november 6 -: "Velas" on april 23 -: "Vendas Novas" on september 7 -: "Viana do Alentejo" on january 13 -: "Viana do Castelo" on august 20 -: "Vidigueira" on easter plus 40 days -: "Vieira do Minho" on first saturday in october plus 2 days -: "Vila do Bispo" on september 20 -: "Vila do Conde" on june 24 -: "Vila Franca do Campo" on june 24 -: "Vila do Porto" on june 24 -: "Vila da Praia da Vitória" on june 20 -: "Vila do Rei" on september 19 -: "Vila Flor" on august 24 -: "Vila Franca de Xira" on easter plus 40 days -: "Vila Nova da Barquinha" on june 13 -: "Vila Nova de Foz Côa" on may 21 -: "Vila Nova de Cerveira" on october 1 -: "Vila Nova de Famalicão" on june 13 -: "Vila Nova de Gaia" on june 24 -: "Vila Nova de Paiva" on march 2 -: "Vila Nova de Poiares" on january 13 -: "Vila Pouca de Aguiar" on june 22 -: "Vila Real" on june 13 -: "Vila Real de Santo António" on may 13 -: "Vila Velha de Ródão" on fourth sunday in august plus 1 day -: "Vila Verde" on june 13 -: "Vila Viçosa" on august 16 -: "Vimioso" on august 10 -: "Vinhais" on may 20 -: "Viseu" on september 21 -: "Vouzela" on may 14 diff --git a/kholidays/holidays/holiday_py b/kholidays/holidays/holiday_py deleted file mode 100644 index 3fc947352..000000000 --- a/kholidays/holidays/holiday_py +++ /dev/null @@ -1,25 +0,0 @@ -: -: Fichero holiday_paraguay. -: Creado por Carlos Raúl Perasso -: -: Feriados Inamovibles -: -red "Año nuevo" red on january 1 -red "Independencia" red on may 15 -red "Virgen de Caacupé" red on december 8 -red "Navidad" red on december 25 -: -: Feriados que tendrían que pasar al siguiente lunes si caen entre martes y viernes -: (No se como establecerlo para korganizer) -: -red "Día de los Heroes" red on march 1 -red "Trabajo" red on may 1 -red "Paz del Chaco" red on june 12 -red "Asunción" red on august 15 -red "Batalla de Boquerón" red on september 29 -: -: Feriados relacionados a la Pascua -: -red "Jueves Santo" red on easter minus 3 days -red "Viernes Santo" red on easter minus 2 days -: diff --git a/kholidays/holidays/holiday_quebec b/kholidays/holidays/holiday_quebec deleted file mode 100644 index 076577da3..000000000 --- a/kholidays/holidays/holiday_quebec +++ /dev/null @@ -1,19 +0,0 @@ -: -: Quebec holiday file. Copy to ~/.holiday -: -: Author: Gildas Perrot -: -small "Jour de l'An" weekend on january 1 -small "St Valentin" on february 14 -small "Vendredi Saint" weekend on easter minus 2 days -small "Paques" weekend on easter -small "Lundi de Paques" weekend on easter plus 1 day -small "Fetes des Meres" on second sunday in may -small "Jour de la Reine (Fete de Dollard)" weekend on monday before may 24 -small "Fetes des Peres" on third sunday in june -small "St-Jean Baptiste" on june 24 -small "Fete de la Confederation" weekend on july 1 -small "Jour du Travail" weekend on first monday in september -small "Action de Graces" weekend on second monday in october -small "Jour du Souvenir (Armistice 1918)" weekend on november 11 -small "Noel" weekend on december 25 diff --git a/kholidays/holidays/holiday_ro b/kholidays/holidays/holiday_ro deleted file mode 100644 index c8276f3c1..000000000 --- a/kholidays/holidays/holiday_ro +++ /dev/null @@ -1,21 +0,0 @@ -: -: Romanian holiday file. Copy to ~/.holiday -: -: Author: Claudiu Costin -: -small "Anul nou" on 1.1. -small "Sărbătoarea unirii" on 24.1 -small "Ziua mamei" on 8.3 -small "Ziua copilului" on 1.6 -small "Ziua naţională" on 1.12 -small "Ziua Revoluţiei" on 22.12 -red "Crăciunul" weekend on 25.12 -small "Ziua muncii" on 1.5 - - -: relativ la Paşte -small "Floriile" on easter minus 6 days -red "Paştele" weekend on easter -small "Înălţarea Domnului" on easter plus 40 days -small "Rusalii" on easter plus 49 days - diff --git a/kholidays/holidays/holiday_ru b/kholidays/holidays/holiday_ru deleted file mode 100644 index 5ea6cc7c6..000000000 --- a/kholidays/holidays/holiday_ru +++ /dev/null @@ -1,111 +0,0 @@ -: -: Russian holiday file. Copy to ~/.holiday -: -: Author: Andrey Cherepanov , September 2006. -: - -: Official holidays -red "Новогодние каникулы" on 1.1 -red "Новогодние каникулы" on 2.1 -red "Новогодние каникулы" on 3.1 -red "Новогодние каникулы" on 4.1 -red "Новогодние каникулы" on 5.1 -red "Рождество Христово" on 7.1 -red "День защитника Отечества" on 23.2 -red "Международный женский день" on 8.3 -red "Праздник Весны и Труда" on 1.5 -red "День Победы" on 9.5 -red "День России" on 12.6 -red "День народного единства" on 4.11 - -: Other holidays -blue "День работника прокуратуры Российской Федерации" on 12.1 -blue "День российской печати" on 13.1 -blue "День инженерных войск" on 21.1 -blue "День российского студенчества" on 25.1 -blue "День снятия блокады города Ленинграда (1944 год)" on 27.1 -blue "Сталинградская битва (1943 год)" on 2.2 -blue "День российской науки" on 8.2 -blue "День дипломатического работника" on 10.2 -blue "День работников геодезии и картографии" on second sunday in march -blue "День работников торговли, бытового обслуживания населения и ЖКХ" on third sunday in march -blue "День внутренних войск МВД" on 27.3 -blue "День специалиста юридической службы в Вооружённых Силах" on 29.3 -blue "День единения народов" on 2.4 -blue "День сотрудников военных комиссариатов" on 8.4 -blue "День геолога" on first sunday in april -blue "День космонавтики" on 12.4 -blue "День войск противовоздушной обороны" on second sunday in april -blue "День специалиста по радиоэлектронной борьбе" on 15.4 -blue "Ледовое побоище (1242 год)" on 18.4 -blue "День памяти погибших в радиационных авариях и катастрофах" on 26.4 -blue "День пожарной охраны" on 30.4 -blue "День радио, праздник работников всех отраслей связи" on 7.5 -blue "День химика" on last sunday in may -blue "День славянской письменности и культуры" on 24.5 -blue "Общероссийский День библиотек" on 27.5 -blue "День пограничника" on 28.5 -blue "Пушкинский день России" on 6.6 -blue "День социального работника" on 8.6 -blue "День работников текстильной и лёгкой промышленности" on second sunday in june -blue "День медицинского работника" on third sunday in june -blue "День изобретателя и рационализатора" on last saturday in june -blue "День памяти и скорби" on 22.6 -blue "День молодёжи" on 27.6 -blue "День работников морского и речного флота" on first sunday in july -blue "Полтавская битва (1709 год)" on 10.7 -blue "День рыбака" on second sunday in july -blue "День российской почты" on second sunday in july -blue "День металлурга" on third sunday in july -blue "День Военно-Морского Флота" on last sunday in july -blue "День Тыла Вооружённых Сил Российской Федерации" on 1.8 -blue "День Воздушно-десантных войск" on 2.8 -blue "День железнодорожника" on first sunday in august -blue "День Железнодорожных войск Российской Федерации" on 6.8 -blue "День победы у мыса Гангут (1714 год)" on 9.8 -blue "День Военно-воздушных сил" on 12.8 -blue "День физкультурника" on second saturday in august -blue "День строителя" on second sunday in august -blue "День Воздушного Флота России" on third sunday in august -blue "День Государственного флага Российской Федерации" on 22.8 -blue "Курская битва (1943 год)" on 23.8 -blue "День шахтёра" on last sunday in august -blue "День кино" on 27.8 -blue "День знаний" on 1.9 -blue "День российской гвардии" on 2.9 -blue "День солидарности в борьбе с терроризмом" on 3.9 -blue "День специалиста по ядерному обеспечению" on 4.9 -blue "День работников нефтяной и газовой промышленности" on first sunday in september -blue "Бородинское сражение (1812 год)" on 8.9 -blue "День победы у мыса Тендра (1790 год)" on 11.9 -blue "День танкиста" on second sunday in september -blue "Куликовская битва (1380 год)" on 21.9 -blue "День работников леса" on third sunday in september -blue "День работника атомной промышленности" on 28.9 -blue "День машиностроителя" on last sunday in september -blue "День пожилых людей" on 1.10 -blue "День Сухопутных войск" on 1.10 -blue "День Космических войск" on 4.10 -blue "День учителя" on 5.10 -blue "День военного связиста" on 20.10 -blue "День подразделений специального назначения" on 24.10 -blue "День таможенника Российской Федерации" on 25.10 -blue "День работника сельского хозяйства и перерабатывающей промышленности" on second sunday in october -blue "День работников дорожного хозяйства" on third sunday in october -blue "День работников автомобильного транспорта" on last sunday in october -blue "День памяти жертв политических репрессий" on 30.10 -blue "День военного разведчика" on 5.11 -blue "Октябрьская революция 1917 года" on 7.11 -blue "День милиции" on 10.11 -blue "День войск радиационной, химической и биологической защиты" on 13.11 -blue "День ракетных войск и артиллерии" on 19.11 -blue "День работника налоговых органов Российской Федерации" on 21.11 -blue "День матери" on last sunday in november -blue "День победы у мыса Синоп (1853 год)" on 1.12 -blue "Битва под Москвой (1941 год)" on 5.12 -blue "День Конституции Российской Федерации" on 12.12 -blue "День Ракетных войск стратегического назначения" on 17.12 -blue "День работника органов безопасности Российской Федерации" on 20.12 -blue "День энергетика" on 22.12 -blue "День взятия крепости Измаил (1790 год)" on 24.12 -blue "День спасателя Российской Федерации" on 27.12 diff --git a/kholidays/holidays/holiday_se b/kholidays/holidays/holiday_se deleted file mode 100644 index d7c1b22fa..000000000 --- a/kholidays/holidays/holiday_se +++ /dev/null @@ -1,37 +0,0 @@ -: -: Swedish holiday file. -: -weekend "Nyårsdagen" weekend on 1.1 -black "Trett.d.afton" black on 5.1 -weekend "Trett.d. Jul" weekend on 6.1 -black "Alla hjärtans dag" on 14.2 -black "Fettisdagen" on easter minus 47 days -black "Askonsdagen" on easter minus 46 days -blue "Sommartid" on last sunday in march -black "Skärtorsdagen" black on easter minus 3 -weekend "Långfredagen" weekend on easter minus 2 -black "Påskafton" black on easter minus 1 -weekend "Påskdagen" weekend on easter -weekend "Annandag påsk" weekend on easter plus 1 -black "Pingstafton" black on easter plus 48 days -weekend "Pingstdagen" weekend on easter plus 49 days -:Before 2005 -:weekend "Annandag Pingst" weekend on easter plus 50 days -black "Annandag Pingst" black on easter plus 50 days -weekend "Kristi Him.f." weekend on easter plus 39 days -weekend "Första Maj" weekend on 1.5 -:Before 2005 -:black "Nationaldagen" black on 6.6 -weekend "Nationaldagen" weekend on 6.6 -black "Midsommarafton" black on friday before 26.6 -weekend "Midsommardagen" weekend on saturday before 27.6 -blue "Vintertid" on last sunday in october -weekend "Alla helgons dag" weekend on first sunday in november minus 1 -black "1. Advent" on sunday before 24.12 minus 21 days -black "2. Advent" on sunday before 24.12 minus 14 days -black "3. Advent" on sunday before 24.12 minus 7 days -black "Julafton" black on 24.12 -black "4. Advent" on sunday before 24.12 -weekend "Juldagen" weekend on 25.12 -weekend "Annandag Jul" weekend on 26.12 -black "Nyårsafton" on 31.12 diff --git a/kholidays/holidays/holiday_si b/kholidays/holidays/holiday_si deleted file mode 100644 index 9417ed753..000000000 --- a/kholidays/holidays/holiday_si +++ /dev/null @@ -1,28 +0,0 @@ -: $Id$ -: $Source$ -: SLOVENIAN HOLIDAY FILE. -: by Roman Maurer -: 2009 by Jure Repinc -: -: Source of information: -: Aleš Košir: Slovenščina in računalniki -: -: Urad vlade za komuniciranje: Prazniki v Republiki Sloveniji -: -: -small "Novo leto" weekend on 1.1. length 2 days -small "Prešernov dan, slovenski kulturni praznik" weekend on 8.2. -small "Velika noč" weekend on easter -small "Velikonočni ponedeljek" weekend on easter plus 1 day -small "Dan upora proti okupatorju" weekend on 27.4. -small "Praznik dela" weekend on 1.5. length 2 days -small "Binkošti" weekend on easter plus 49 days -small "Dan državnosti" weekend on 25.6. -small "Marijino vnebovzetje" weekend on 15.8. -small "Združitev prekmurskih Slovencev z matičnim narodom" on 17.8. -small "Vrnitev Primorske k matični domovini" on 15.9. -small "Dan reformacije" weekend on 31.10. -small "Dan spomina na mrtve" weekend on 1.11. -small "Dan Rudolfa Maistra" on 23.11. -small "Božič" weekend on 25.12. -small "Dan samostojnosti in enotnosti" weekend on 26.12. diff --git a/kholidays/holidays/holiday_sk b/kholidays/holidays/holiday_sk deleted file mode 100644 index c468b258f..000000000 --- a/kholidays/holidays/holiday_sk +++ /dev/null @@ -1,29 +0,0 @@ -: -: Slovak holiday file. Copy to ~/.holiday -: Author: Michal Vančo -: -small "Nový rok" weekend on 1.1. -small "Deň vzniku SR" weekend on 1.1. -small "Traja králi" weekend on 6.1. -small "Medzinárodný deň žien" on 8.3. -: Veľká noc patrí niekde sem -small "Veľký piatok" weekend on easter minus 2 -small "Veľkonočná nedeľa" weekend on easter -small "Veľkonočný pondelok" weekend on easter plus 1 -small "Deň učiteľov" on 28.4. -small "Sviatok práce" weekend on 1.5. -small "Deň víťazstva nad fašizmom" weekend on 8.5. -small "Deň matiek" on 13.5. -small "Medzinárodný deň detí" on 1.6. -small "Deň otcov" on 17.6. -small "Sviatok sv. Cyrila a Metoda" weekend on 5.7. -small "Výročie SNP" weekend on 29.8. -small "Deň Ústavy SR" weekend on 1.9. -small "Sedembolestná Panna Mária" weekend on 15.9. -small "Sviatok všetkých svätých" weekend on 1.11. -small "Pamiatka zosnulých" on 2.11. -small "Deň boja za slobodu a demokraciu" weekend on 17.11. -small "Štedrý deň" weekend on 24.12. -small "1. sviatok vianočný" weekend on 25.12. -small "2. sviatok vianočný" weekend on 26.12. - diff --git a/kholidays/holidays/holiday_th b/kholidays/holidays/holiday_th deleted file mode 100644 index da97605ce..000000000 --- a/kholidays/holidays/holiday_th +++ /dev/null @@ -1,30 +0,0 @@ -: -: Thailand holiday file. Copy to ~/.holiday -: Use this as a starting point, These are the Official holidays. -: Chineese New Year along with most other Chineese holidays are also -: widely celebrated but not included here. -: -: -: Author: Gerald Williams -: -black "New Year" on January 1 -red "Makha Bucha Day" on February 11 -black "Chakri Day" on April 6 -black "Songkran Festival" weekend on April 13 -black "Coranation Day" on May 5 -black "Ploughing Ceremony" on May 8 -red "Visakha Bucha Day" on May 10 -black "Mid Year Day" on July 1 -red "Asarnha Bucha Day" on July 8 -red "Khao Phansa Day" on July 9 -black "H.M.The Queens B'day" on August 12 -black "Chulalongkorn Day" on October 23 -black "H.M. The King's B'day" on December 5 -black "Constitution Day" on December 10 -black "New Years Eve" on December 31 - - -: Seasons (Basically only three) -green "Hot season Begins" on march 1 -green "Rainy season Begins" on june 1 -green "Cool season Begins" on november 1 diff --git a/kholidays/holidays/holiday_ua b/kholidays/holidays/holiday_ua deleted file mode 100644 index 6e8361073..000000000 --- a/kholidays/holidays/holiday_ua +++ /dev/null @@ -1,118 +0,0 @@ -: -: Ukrainian holiday file. Copy to ~/.holiday -: -: Authors: Andriy Gapon , April 2007. -: Oleg Ivashchenko , October 2006. -: - -: Official holidays -small "Новий Рік" weekend on 1.1 -small "Різдво Христове" weekend on 7.1 -small "8 Березня - Міжнародний Жіночий День" weekend on 8.3 -small "Великдень" weekend on pascha -small "1 Травня - День Праці" weekend on 1.5 length 2 days -small "День Перемоги" weekend on 9.5 -small "Трійця" weekend on pascha plus 49 days -small "День Конституції України" weekend on 28.6 -small "День Незалежності України" weekend on 24.8 - -: Other holidays -blue "Хрещення" on 19.1 -blue "День соборності України" on 22.1 -blue "День пам’яті Крутів" on 29.1 -blue "День працівників пожежної охорони" on 29.1 -blue "День вшанування учасників бойових дій на території інших держав" on 15.2 -blue "День захисника Вітчизни" on 23.2 -blue "День землевпорядника" on second saturday in march -blue "День працівників житлово-комунального господарства і побутового обслуговування населення" on third sunday in march -blue "Всеукраїнський день працівників культури та аматорів народного мистецтва" on 23.3 -blue "Всеукраїнський день боротьби із захворюванням на туберкульоз" on 24.3 -blue "День Служби безпеки України" on 25.3 -blue "День внутрішніх військ Міністерства внутрішніх справ України" on 26.3 -blue "День геолога" on first sunday in april -blue "День працівників ракетно-космічної галузі України" on 12.4 -blue "День пам'яток історії та культури" on 18.4 -blue "День довкілля" on third saturday in april -blue "День охорони праці" on 28.4 -blue "День матері" on second sunday in may -blue "День банківських працівників" on 20.5 -blue "День науки" on third saturday in may -blue "День Європи" on third saturday in may -blue "День працівників видавництв, поліграфії і книгорозповсюдження" on last saturday in may -blue "День хіміка" on last sunday in may -blue "Міжнародний день миротворців Організації Об'єднаних Націй" on 29.5 -blue "День слов'янської писемності і культури" 24.5 -blue "День прикордонника" on 28.5 -blue "День захисту дітей" on 1.6 -blue "День журналіста" on 6.6 -blue "День працівників місцевої промисловості" on first sunday in june -blue "День працівників водного господарства" on first sunday in june -blue "День працівників легкої промисловості" on second sunday in june -blue "День медичного працівника" on third sunday in june -blue "День скорботи і вшанування пам'яті жертв війни в Україні" on 22.6 -blue "День державної служби" on 23.6 -blue "День митної служби України" on 25.6 -blue "День молоді" on last sunday in june -blue "День архітектури України" on 1.7 -blue "День працівника державної податкової служби України" on 2.7 -blue "День Військ Протиповітряної оборони" on first sunday in july -blue "День Військово-Морських Сил" on first sunday in july -blue "День працівників морського та річкового флоту" on first sunday in july -blue "День рибалки" on second sunday in july -blue "День бухгалтера" on 16.7 -blue "День працівників металургійної та гірничодобувної промисловості" on third sunday in july -blue "День працівників торгівлі" on last sunday in july -blue "День аеромобільних військ" on 2.8 -blue "День військ зв'язку" on 8.8 -blue "День будівельника" on second sunday in august -blue "День працівників ветеринарної медицини" on second sunday in august -blue "День пасічника" on 19.8 -blue "День Державного Прапора України" on 23.8 -blue "День авіації" on last saturday in august -blue "День шахтаря" on last sunday in august -blue "День підприємця" on first sunday in september -blue "День фізичної культури і спорту" on second saturday in september -blue "День танкістів" on second sunday in september -blue "День працівників нафтової, газової та нафтопереробної промисловості" on second sunday in september -blue "День українського кіно" on second saturday in september -blue "День працівників цивільного захисту" on 17.9 -blue "День миру" on 21.9 -blue "День партизанської слави" on 22.9 -blue "День фармацевтичного працівника" on third saturday in september -blue "День винахідника і раціоналізатора" on third saturday in september -blue "День працівника лісу" on third sunday in september -blue "День машинобудівника" on fourth sunday in september -blue "День туризму" on 27.9 -blue "Всеукраїнський день бібліотек" on 30.9 -blue "День працівників освіти" on first sunday in october -blue "День юриста" on 8.10 -blue "День працівників стандартизації та метрології" on 10.10 -blue "День працівників державної санітарно-епідеміологічної служби" on second sunday in october -blue "День художника" on second sunday in october -blue "День Українського козацтва" on 14.10 -blue "День працівників харчової промисловості" on third sunday in october -blue "День автомобіліста і дорожника" on last sunday in october -blue "День інженерних військ" on 3.11 -blue "День ракетних військ і артилерії" on 3.11 -blue "День залізничника" on 4.11 -blue "День працівника соціальної сфери" on first sunday in november -blue "День української писемності та мови" on 9.11 -blue "День працівників радіо, телебачення та зв'язку" on 16.11 -blue "День студента" on 17.11 -blue "День працівників гідрометеорологічної служби" on 19.11 -blue "День скловиробника" on 19.11 -blue "День Свободи" on 22.11 -blue "День працівників сільського господарства" on third sunday in november -blue "День пам'яті жертв голодоморів та політичних репресій" on fourth saturday in november -blue "День працівників прокуратури" on 1.12 -blue "День працівників статистики" on 5.12 -blue "День Збройних Сил України" on 6.12 -blue "День місцевого самоврядування" on 7.12 -blue "День Сухопутних військ України" on 12.12 -blue "День вшанування учасників ліквідації наслідків аварії на Чорнобильській АЕС" on 14.12 -blue "День працівників суду" on 15.12 -blue "День адвокатури" on 19.12 -blue "День міліції" on 20.12 -blue "День працівників дипломатичної служби" on 22.12 -blue "День енергетика" on 22.12 -blue "День працівників архівних установ" on 24.12 diff --git a/kholidays/holidays/holiday_us b/kholidays/holidays/holiday_us deleted file mode 100644 index f0962f105..000000000 --- a/kholidays/holidays/holiday_us +++ /dev/null @@ -1,54 +0,0 @@ -: -: US holiday file. Copy to ~/.holiday -: Use this as a starting point, some holidays are missing, and some listed -: here are largely irrelevant. -: -: Author: Ron Harichandran -: -: Federal holidays -small "New Year's Day" weekend on 1/1 -small "Martin Luther King's Birthday" weekend on third monday in january -small "President's Day" weekend on third monday in february -small "Memorial Day" weekend on last monday in may -small "Independence Day" weekend on july 4 -small "Labor Day" weekend on first monday in september -small "Columbus Day" weekend on second monday in october -small "Veterans Day" weekend on november 11 -small "Thanksgiving" weekend on fourth thursday in november -small "Christmas Day" weekend on december 25 - -: -: more holidays from Jeff Buhrt -: -small "Groundhog Day" on february 2 -small "Lincoln's Birthday" on february 12 -small "St. Valentine's Day" on february 14 -small "Susan B. Anthony's Day" on february 15 -small "St. Patrick's Day" on march 17 -small "Arbor Day" on last friday in april -small "Loyalty Day" on may 1 -small "Mother's Day" on second sunday in may -small "Armed Forces Day" on third saturday in may -: small "Victoria Day" on monday in may and 18 thru 24 -small "Father's Day" on third sunday in june -small "Citizenship Day" on september 17 -small "Child Health Day" on first monday in september -small "World Poetry Day" on october 15 -small "United Nations' Day" on october 24 -small "Halloween" on october 31 -small "Bill of Rights' Day" on december 15 -small "Wright Brothers' Day" on december 17 - -: Easter related -small "Easter" weekend on easter -small "Ash Wednesday" on easter minus 46 days -small "Pentecost" weekend on easter plus 49 days -small "Ascension" on easter plus 40 days -small "Trinity" on easter plus 46 days -small "Corpus Christi" on easter plus 53 days - -: Seasons (are these really hardcoded or calculated?) -"Spring Begins" on march 22 -"Summer Begins" on june 22 -"Fall Begins" on september 22 -"Winter Begins" on december 22 diff --git a/kholidays/holidays/holiday_uy b/kholidays/holidays/holiday_uy deleted file mode 100644 index 56b0128ff..000000000 --- a/kholidays/holidays/holiday_uy +++ /dev/null @@ -1,39 +0,0 @@ -: KOrganizer Uruguayan holiday file. -: -: Pablo R Hoffman -: -: $Id$ -: -------------------------------------------------------------------------- -: -: NOTA: Los feriados que se corren para los lunes son arbitrarios y los -: elije el gobierno uruguayo cada año. Por lo tanto aqui estan listados -: unicamente las fechas originales (sin correr). -: -: Feriados no laborables -: -small "Año nuevo" on 1 january -small "Jura de la constituación" on 18 july -small "Declaratoria de Independencia" on 25 august -small "Día del Trabajo" on 1 may -small "Día de los difuntos" on 2 november -small "Navidad" on 25 december -: -: Feriados laborables -: -small "Día de Reyes" on 6 january -small "Desembarco 33 Orientales" on 19 april -small "Batalla de las Piedras" on 18 may -small "Natalicio de Artigas" on 19 june -small "Día de las Américas" on 18 october -: -: Semana de turismo -: -small "Domingo de Pascua" on easter -small "Sábado de gloria" on easter minus 1 day -small "Viernes santo" on easter minus 2 days -small "Jueves santo" on easter minus 3 days -: -: Carnaval ( cada año es diferente ) -: -small "Carnaval" on easter minus 48 days -small "Carnaval" on easter minus 47 days diff --git a/kholidays/holidays/holiday_za b/kholidays/holidays/holiday_za deleted file mode 100644 index 5fe5aeaf9..000000000 --- a/kholidays/holidays/holiday_za +++ /dev/null @@ -1,17 +0,0 @@ -: -: South African holiday file. Copy to ~/.holiday -: -: Author: Anton Keyter -: -red "New Year's Day" on january 1 shift to monday if sunday -red "Human Rights Day" on march 21 shift to monday if sunday -red "Good Friday" on easter minus 2 day -red "Family Day" on easter plus 1 day -red "Freedom Day" on april 27 shift to monday if sunday -red "Workers Day" on may 1 shift to monday if sunday -red "Youth Day" on june 16 shift to monday if sunday -red "National Women's Day" on august 9 shift to monday if sunday -red "Heritage Day" on september 24 shift to monday if sunday -red "Day of Reconsiliation" on december 16 shift to monday if sunday -red "Christmas Day" on december 25 shift to monday if sunday -red "Day of Goodwill" on december 26 shift to monday if sunday diff --git a/kholidays/kholidays.cpp b/kholidays/kholidays.cpp deleted file mode 100644 index 69791d773..000000000 --- a/kholidays/kholidays.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2001 Cornelius Schumacher - Copyright (c) 2004 Allen Winter - Copyright (c) 2008 David Jarvie - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kholidays.h" -#include "kholidays_version.h" - -#include - -#include -#include - -using namespace LibKHolidays; - -extern "C" { - char *parse_holidays( const char *, int year, short force ); - /** \internal */ - struct holiday { - char *string; /* name of holiday, 0=not a holiday */ - int color; /* color code, see scanholiday.lex */ - unsigned short dup; /* reference count */ - holiday *next; /* single-linked list if more than one holiday - appears on a given date */ - }; - extern struct holiday holidays[366]; -} - -QStringList KHolidays::locations() -{ - const QStringList files = - KGlobal::dirs()->findAllResources( "data", "libkholidays/holiday_*", - KStandardDirs::NoDuplicates ); - QStringList locs; - - QStringList::ConstIterator it; - for ( it = files.constBegin(); it != files.constEnd(); ++it ) { - locs.append( (*it).mid( (*it).lastIndexOf( '_' ) + 1 ) ); - } - - return locs; -} - -KHolidays::KHolidays( const QString &location ) - : mLocation( location ), - mYearLast( 0 ) -{ - if ( !location.isEmpty() ) { - mHolidayFile = KStandardDirs::locate( "data", "libkholidays/holiday_" + location ); - if ( mHolidayFile.isEmpty() ) { - mLocation.clear(); - } - } -} - -KHolidays::~KHolidays() -{ -} - -QString KHolidays::location() const -{ - return mLocation; -} - -bool KHolidays::isValid() const -{ - return !mHolidayFile.isEmpty(); -} - -bool KHolidays::parseFile( const QDate &date ) const -{ - int lastYear = 0; //current year less 1900 - - if ( mHolidayFile.isEmpty() || !date.isValid() ) { - return false; - } - - if ( ( date.year() != mYearLast ) || ( mYearLast == 0 ) ) { - mYearLast = date.year(); - lastYear = date.year() - 1900; // silly parse_year takes 2 digit year... - parse_holidays( QFile::encodeName( mHolidayFile ), lastYear, 1 ); - } - - return true; -} - -QList KHolidays::getHolidays( const QDate &date ) const -{ - QList list; - if ( !parseFile( date ) ) { - return list; - } - struct holiday *hd = &holidays[date.dayOfYear()-1]; - while ( hd ) { - if ( hd->string ) { - KHoliday holiday; - holiday.text = QString::fromUtf8( hd->string ); - holiday.shortText = holiday.text; - holiday.Category = ( hd->color == 2/*red*/ ) || ( hd->color == 9/*weekend*/ ) ? - HOLIDAY : WORKDAY; - list.append( holiday ); - } - hd = hd->next; - } - return list; -} - -bool KHolidays::isHoliday( const QDate &date ) const -{ - if ( !parseFile( date ) ) { - return false; - } - struct holiday *hd = &holidays[date.dayOfYear()-1]; - while ( hd ) { - if ( hd->string && ( hd->color == 2/*red*/ || hd->color == 9/*weekend*/ ) ) { - return true; - } - hd = hd->next; - } - return false; -} diff --git a/kholidays/kholidays.h b/kholidays/kholidays.h deleted file mode 100644 index a527f68a1..000000000 --- a/kholidays/kholidays.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2001 Cornelius Schumacher - Copyright (c) 2004 Allen Winter - Copyright (c) 2008 David Jarvie - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef KHOLIDAYS_HOLIDAYS_H -#define KHOLIDAYS_HOLIDAYS_H - -#include "kholidays_export.h" - -#include -#include -#include - -class QDate; - -namespace LibKHolidays { - -struct KHoliday { - QString text; - QString shortText; - int Category; -}; - -class KHOLIDAYS_EXPORT KHolidays -{ - public: - /** - Return a list of all available location codes which have a holiday definition. - One of these can then be passed to the constructor for a new KHolidays - object. - */ - static QStringList locations(); - - /** - Constructor. - @param location the code for the country or region. If null - or unknown, an empty instance will be created. - */ - explicit KHolidays( const QString &location = QString() ); - ~KHolidays(); - - /** - Returns the holiday location. - This is a code representing the country or region. - @return region code, or null if the instance was constructed with - an unknown region - */ - QString location() const; - - QList getHolidays( const QDate &date ) const; - - /** - Checks whether there is any holiday defined for a date. - */ - bool isHoliday( const QDate &date ) const; - - /** - Returns whether the instance contains any holiday data. - */ - bool isValid() const; - - enum { - WORKDAY, - HOLIDAY - }; - - private: - // Prohibit copying - KHolidays(const KHolidays& ); - KHolidays &operator=(const KHolidays& ); - - bool parseFile( const QDate &date ) const; - - QString mLocation; // location string used to determine holidays file - QString mHolidayFile; // full path of file containing holiday data, or null - mutable int mYearLast;// save of the last year we have seen -}; - -} - -#endif diff --git a/kholidays/kholidays_export.h b/kholidays/kholidays_export.h deleted file mode 100644 index 4eca62aab..000000000 --- a/kholidays/kholidays_export.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (C) 2007 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KHOLIDAYS_EXPORT_H -#define KHOLIDAYS_EXPORT_H - -/* needed for KDE_EXPORT and KDE_IMPORT macros */ -#include - -#ifndef KHOLIDAYS_EXPORT -# if defined(MAKE_KHOLIDAYS_LIB) - /* We are building this library */ -# define KHOLIDAYS_EXPORT KDE_EXPORT -# else - /* We are using this library */ -# define KHOLIDAYS_EXPORT KDE_IMPORT -# endif -#endif - -# ifndef KHOLIDAYS_EXPORT_DEPRECATED -# define KHOLIDAYS_EXPORT_DEPRECATED KDE_DEPRECATED KHOLIDAYS_EXPORT -# endif - -#endif diff --git a/kholidays/kholidays_version.h b/kholidays/kholidays_version.h deleted file mode 100644 index b1e31920a..000000000 --- a/kholidays/kholidays_version.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KHOLIDAYS_KHOLIDAYS_VERSION_H -#define KHOLIDAYS_KHOLIDAYS_VERSION_H - -#define LIBKHOLIDAYS_VERSION_STRING "1.3.90" -#define LIBKHOLIDAYS_VERSION_MAJOR 1 -#define LIBKHOLIDAYS_VERSION_MINOR 3 -#define LIBKHOLIDAYS_VERSION_RELEASE 90 - -#define LIBKHOLIDAYS_VERSION KDE_MAKE_VERSION( LIBKHOLIDAYS_VERSION_MAJOR, \ - LIBKHOLIDAYS_VERSION_MINOR, \ - LIBKHOLIDAYS_VERSION_RELEASE ) - -#define LIBKHOLIDAYS_IS_VERSION( a, b, c ) \ - ( LIBKHOLIDAYS_VERSION >= KDE_MAKE_VERSION( a, b, c ) ) - -#endif diff --git a/kholidays/lunarphase.cpp b/kholidays/lunarphase.cpp deleted file mode 100644 index 6005f99bf..000000000 --- a/kholidays/lunarphase.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2007 Allen Winter - - Copyright (c) 1989, 1993 //krazy:exclude=copyright - The Regents of the University of California. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "lunarphase.h" -#include - -#include -#include -#include - -using namespace LibKHolidays; - -LunarPhase::LunarPhase() -{ -} - -LunarPhase::~LunarPhase() -{ -} - -QString LunarPhase::phaseStr( const QDate &date ) const -{ - return phaseName( phase( date ) ); -} - -QString LunarPhase::phaseName( LunarPhase::Phase phase ) -{ - switch ( phase ) { - case NewMoon: - return( i18n( "New Moon" ) ); - case FullMoon: - return( i18n( "Full Moon" ) ); - case FirstQuarter: - return( i18n( "First Quarter Moon" ) ); - case LastQuarter: - return( i18n( "Last Quarter Moon" ) ); - default: - case None: - return QString(); - } -} - -LunarPhase::Phase LunarPhase::phase( const QDate &date ) const -{ - Phase retPhase = None; - - // compute percent-full for the middle of today and yesterday. - QTime noontime( 12, 0, 0 ); - QDateTime today( date, noontime ); - double todayPer = percentFull( today.toTime_t() ); - QDateTime yesterday( date.addDays(-1), noontime ); - double yesterdayPer = percentFull( yesterday.toTime_t() ); - - if ( ( todayPer < 0.50 ) && ( yesterdayPer > 0.50 ) ) { - retPhase = NewMoon; - } else if ( ( todayPer > 99.50 ) && ( yesterdayPer < 99.50 ) ) { - retPhase = FullMoon; - } else { - // compute percent-full for the start of today. - QTime sqt( 0, 0, 0 ); - QDateTime start( date, sqt ); - double startPer = percentFull( start.toTime_t() ); - // compute percent-full for the end of today. - QTime eqt( 23, 59, 59 ); - QDateTime end( date, eqt ); - double endPer = percentFull( end.toTime_t() ); - - if ( ( startPer <= 50 ) && ( endPer > 50 ) ) { - retPhase = FirstQuarter; - } - if ( ( endPer <= 50 ) && ( startPer > 50 ) ) { - retPhase = LastQuarter; - } - // Note: if you want to support crescent and gibbous phases then please - // read the source for the original BSD 'pom' program. - } - return( retPhase ); -} - -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software posted to USENET. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifdef HAVE_SYS_CDEFS_H -#include -#endif - -/* - * Phase of the Moon. Calculates the current phase of the moon. - * Based on routines from `Practical Astronomy with Your Calculator', - * by Duffett-Smith. Comments give the section from the book that - * particular piece of code was adapted from. - * - * -- Keith E. Brandt VIII 1984 - * - * Updated to the Third Edition of Duffett-Smith's book, Paul Janzen, IX 1998 - * - */ - -#include -#ifdef HAVE_ERR_H -#include -#endif -#include -#include -#include -#include -#include - -#ifndef PI -#define PI 3.14159265358979323846 -#endif - -/* - * The EPOCH in the third edition of the book is 1990 Jan 0.0 TDT. - * In this program, we do not bother to correct for the differences - * between UTC (as shown by the UNIX clock) and TDT. (TDT = TAI + 32.184s; - * TAI-UTC = 32s in Jan 1999.) - */ -#define EPOCH_MINUS_1970 (20 * 365 + 5 - 1) /* 20 years, 5 leaps, back 1 day to Jan 0 */ -#define EPSILONg 279.403303 /* solar ecliptic long at EPOCH */ -#define RHOg 282.768422 /* solar ecliptic long of perigee at EPOCH */ -#define ECCEN 0.016713 /* solar orbit eccentricity */ -#define lzero 318.351648 /* lunar mean long at EPOCH */ -#define Pzero 36.340410 /* lunar mean long of perigee at EPOCH */ -#define Nzero 318.510107 /* lunar mean long of node at EPOCH */ - -/* - * percentFull -- - * return phase of the moon as a percentage of full - */ -double LunarPhase::percentFull( uint tmpt ) const -{ - double N, Msol, Ec, LambdaSol, l, Mm, Ev, Ac, A3, Mmprime; - double A4, lprime, V, ldprime, D, Nm; - - double days; - days = ( tmpt - EPOCH_MINUS_1970 * 86400 ) / 86400.0; - - N = 360 * days / 365.242191; /* sec 46 #3 */ - adj360( &N ); - Msol = N + EPSILONg - RHOg; /* sec 46 #4 */ - adj360( &Msol ); - Ec = 360 / PI * ECCEN * sin( degreesToRadians( Msol ) ); /* sec 46 #5 */ - LambdaSol = N + Ec + EPSILONg; /* sec 46 #6 */ - adj360( &LambdaSol ); - l = 13.1763966 * days + lzero; /* sec 65 #4 */ - adj360( &l ); - Mm = l - ( 0.1114041 * days ) - Pzero; /* sec 65 #5 */ - adj360( &Mm ); - Nm = Nzero - ( 0.0529539 * days ); /* sec 65 #6 */ - adj360( &Nm ); - Ev = 1.2739 * sin( degreesToRadians( 2 * ( l - LambdaSol ) - Mm ) ); /* sec 65 #7 */ - Ac = 0.1858 * sin( degreesToRadians( Msol ) ); /* sec 65 #8 */ - A3 = 0.37 * sin( degreesToRadians( Msol ) ); - Mmprime = Mm + Ev - Ac - A3; /* sec 65 #9 */ - Ec = 6.2886 * sin( degreesToRadians( Mmprime ) ); /* sec 65 #10 */ - A4 = 0.214 * sin( degreesToRadians( 2 * Mmprime ) ); /* sec 65 #11 */ - lprime = l + Ev + Ec - Ac + A4; /* sec 65 #12 */ - V = 0.6583 * sin( degreesToRadians( 2 * ( lprime - LambdaSol ) ) );/* sec 65 #13 */ - ldprime = lprime + V; /* sec 65 #14 */ - D = ldprime - LambdaSol; /* sec 67 #2 */ - D = 50.0 * ( 1 - cos( degreesToRadians( D ) ) ); /* sec 67 #3 */ - return D; -} - -/* - * degreesToRadians -- - * convert degrees to radians - */ -double LunarPhase::degreesToRadians( double degree ) const -{ - return( degree * PI / 180 ); -} - -/* - * adj360 -- - * adjust value so 0 <= degree <= 360 - */ -void LunarPhase::adj360( double *degree ) const -{ - for ( ;; ) { - if ( *degree < 0 ) { - *degree += 360; - } else if ( *degree > 360 ) { - *degree -= 360; - } else { - break; - } - } -} diff --git a/kholidays/lunarphase.h b/kholidays/lunarphase.h deleted file mode 100644 index e16ab2fe1..000000000 --- a/kholidays/lunarphase.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KHOLIDAYS_LUNARPHASE_H -#define KHOLIDAYS_LUNARPHASE_H - -#include "kholidays_export.h" -#include - -class QDate; - -namespace LibKHolidays { - -/** - Represents and manages a Lunar Phase - - A Lunar Phase can be one of the following: - - + "new": the moon is not visible; or traditionally: first visible - crescent of the Moon. For religious purposes, the new - month begins when the first crescent moon can be seen. - Thus, it is impossible to be certain in advance of when - months will begin; in particular, the exact date on which - Ramadan will begin is not known in advance. In Saudi Arabia, - observers are sent up in airplanes if the weather is cloudy - when the new moon is expected. - + "first quarter": the right 50% of the moon is visible. - + "full": the moon is fully visible. - + "last quarter": the left 50% of the moon is visible. - - A very good description of the lunar phases can be read at the Wikipedia, - http://en.wikipedia.org/wiki/Lunar_phase - - Note that crescent and gibbous phases are not currently supported. -*/ -class KHOLIDAYS_EXPORT LunarPhase -{ - public: - /** - Phases of the moon, in traditional English notation. The - phase @c None is used only as an error indicator, for instance - in phase(). - */ - enum Phase { - NewMoon, - FirstQuarter, - LastQuarter, - FullMoon, - None - }; - - /** - Constructor. - */ - - LunarPhase(); - - /** - Destructor. - */ - ~LunarPhase(); - - /** - Return the lunar phase for the specified Gregorian date. - The enum 'None' is returned if one of the supported phases - does not occur on the date. - - @param date compute the lunar phase for the specified Gregorian date. - */ - Phase phase( const QDate &date ) const; - - /** - Return the lunar phase as a text string for the specified date. - A null string is returned if one of the supported phases does - not occur on the date. - - @param date compute the lunar phase for the specified Gregorian date. - */ - QString phaseStr( const QDate &date ) const; - - /** - Return the string representation of phase. - - @param phase the lunar phase. - */ - static QString phaseName( Phase phase ); - - private: - /** - Return the phase of the moon as a percentage of full - - @param t is the time since the Epoch, measured in seconds. - - @return the percent fullness [0,100] of the moon. - */ - double percentFull( uint t ) const; - - /** - Convert degrees to radians. - - @param degree degrees to convert. - - @return degrees in radians. - */ - double degreesToRadians( double degree ) const; - - /** - Adjust value so that 0 <= degree <= 360. - - @param degree a pointer to the degree value. - */ - void adj360( double *degree ) const; -}; - -} - -#endif diff --git a/kholidays/parseholiday.c b/kholidays/parseholiday.c deleted file mode 100644 index 8f639c086..000000000 --- a/kholidays/parseholiday.c +++ /dev/null @@ -1,2656 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse kcalparse -#define yylex kcallex -#define yyerror kcalerror -#define yylval kcallval -#define yychar kcalchar -#define yydebug kcaldebug -#define yynerrs kcalnerrs - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NUMBER = 258, - MONTH = 259, - WDAY = 260, - COLOR = 261, - STRING = 262, - HOLIDAY_IN = 263, - PLUS = 264, - MINUS = 265, - SMALL = 266, - CYEAR = 267, - LEAPYEAR = 268, - SHIFT = 269, - IF = 270, - LENGTH = 271, - EASTER = 272, - EQ = 273, - NE = 274, - LE = 275, - GE = 276, - LT = 277, - GT = 278, - PASCHA = 279, - OR = 280, - AND = 281, - UMINUS = 282 - }; -#endif -/* Tokens. */ -#define NUMBER 258 -#define MONTH 259 -#define WDAY 260 -#define COLOR 261 -#define STRING 262 -#define HOLIDAY_IN 263 -#define PLUS 264 -#define MINUS 265 -#define SMALL 266 -#define CYEAR 267 -#define LEAPYEAR 268 -#define SHIFT 269 -#define IF 270 -#define LENGTH 271 -#define EASTER 272 -#define EQ 273 -#define NE 274 -#define LE 275 -#define GE 276 -#define LT 277 -#define GT 278 -#define PASCHA 279 -#define OR 280 -#define AND 281 -#define UMINUS 282 - - - - -/* Copy the first part of user declarations. */ -#line 1 "parseholiday.y" - -/* - * deals with the holiday file. A yacc parser is used to parse the file. - * All the holidays of the specified year are calculated at once and stored - * in two arrays that have one entry for each day of the year. The day - * drawing routines just use the julian date to index into these arrays. - * There are two arrays because holidays can be printed either on a full - * line under the day number, or as a small line to the right of the day - * number. It's convenient to have both. - * - * parse_holidays(year, force) read the holiday file and evaluate - * all the holiday definitions for - * . Sets holiday and sm_holiday - * arrays. If force is set, re-eval even - * if year is the same as last time. - * - * Taken from plan by Thomas Driemeyer - * Adapted for use in KOrganizer by Preston Brown and - * Reinhold Kainhofer - */ - -#include - -#include -#include -#ifdef HAVE_MALLOC_H -# include -#endif -#include -#include -#include -#include -#include -#include - -#include - -/*** Macro definitions and constants ***/ -/* - * Before you mail and complain that the following macro is incorrect, - * please consider that this is one of the main battlegrounds of the - * Annual Usenet Flame Wars. 2000 is a leap year. Just trust me on this :-) - */ - -#define ISLEAPYEAR(y) !((y)&3) -#define JULIAN(m,d) (monthbegin[m] + (d)-1+((m)>1 && ISLEAPYEAR(parse_year))) -#define LAST 999 -#define ANY 0 -#define BEFORE -1 -#define AFTER -2 -/**** Public forward declarations ****/ -char *parse_holidays(const char *holidays, int year, short force); - -/**** Private forward declarations ****/ -extern int kcallex(void); /* external lexical analyzer */ -static void kcalerror(const char *s); -static time_t date_to_time(int day, int month, int year, - int *wkday, int *julian, int *weeknum); -static time_t tm_to_time(struct tm *tm); -static int day_from_name(char *str); -static int day_from_easter(void); -static int day_from_monthday(int month, int day); -static int day_from_wday(int day, int wday, int num); -static void monthday_from_day(int day, int *m, int *d, int *y); -static int calc_easter(int year); -static int calc_pascha(int year); -static void setliteraldate(int month, int day, int off, int *ddup); -static void seteaster(int off, int length, int pascha); -static void setdate(int month, int day, int year, int off, int conditionaloff, int length); -static void setwday(int num, int wday, int month, int off, int length); -static void setdoff(int wday, int rel, int month, int day, - int year, int off, int length); -/*** Variables and structures ***/ -static int m, d, y; -int kcallineno; /* current line # being parsed */ -int yacc_small; /* small string or on its own line? */ -int yacc_stringcolor; /* color of holiday name text, 1..8 */ -char *yacc_string; /* holiday name text */ -int yacc_daycolor; /* color of day number, 1..8 */ -char *progname; /* argv[0] */ -int parse_year = -1; /* year being parsed, 0=1970..99=2069*/ -static const char *filename; /* holiday filename */ -static char errormsg[PATH_MAX+200];/* error message if any, or "" */ -static int easter_julian; /* julian date of Easter Sunday */ -static int pascha_julian; /* julian date of Pascha Sunday */ -static char *holiday_name; /* strdup'd yacc_string */ -short monthlen[12] = { 31, 28, 31, 30, - 31, 30, 31, 31, - 30, 31, 30, 31 }; -short monthbegin[12] = { 0, 31, 59, 90, - 120, 151, 181, - 212, 243, 273, - 304, 334 }; - -/* struct holiday;*/ -struct holiday { - char *string; /* name of holiday, 0=not a holiday */ - int color; - unsigned short dup; /* reference count */ - struct holiday *next; -}; - -struct holiday holidays[366]; /* info for each day, separate for */ -/*struct holiday sm_holiday[366];*/ /* full-line texts under, and small */ - /* texts next to day number */ -static int initialized=0; - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 110 "parseholiday.y" -{ int ival; char *sval; } -/* Line 193 of yacc.c. */ -#line 269 "parseholiday.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 216 of yacc.c. */ -#line 282 "parseholiday.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 278 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 41 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 16 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 70 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 132 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 282 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 32, 2, 2, 2, 31, 2, 2, - 39, 40, 29, 28, 2, 27, 36, 30, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 35, 2, - 2, 2, 2, 34, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 37, 2, 38, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 33 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 4, 5, 13, 14, 16, 17, 19, - 23, 27, 32, 36, 41, 48, 54, 55, 58, 61, - 62, 67, 68, 70, 74, 75, 78, 82, 87, 93, - 97, 103, 106, 110, 113, 117, 122, 124, 126, 128, - 132, 137, 141, 144, 147, 151, 156, 158, 160, 162, - 166, 170, 174, 178, 182, 186, 190, 194, 198, 202, - 206, 210, 214, 220, 223, 227, 231, 233, 235, 238, - 240 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 42, 0, -1, -1, -1, 42, 44, 45, 7, 45, - 43, 46, -1, -1, 11, -1, -1, 6, -1, 17, - 47, 50, -1, 24, 47, 50, -1, 51, 47, 48, - 50, -1, 5, 47, 50, -1, 55, 5, 47, 50, - -1, 55, 5, 8, 53, 47, 50, -1, 5, 55, - 51, 47, 50, -1, -1, 9, 54, -1, 10, 54, - -1, -1, 14, 49, 15, 49, -1, -1, 5, -1, - 5, 25, 49, -1, -1, 16, 54, -1, 55, 36, - 53, -1, 55, 36, 53, 36, -1, 55, 36, 53, - 36, 54, -1, 53, 30, 55, -1, 53, 30, 55, - 30, 55, -1, 4, 55, -1, 4, 55, 55, -1, - 55, 4, -1, 55, 4, 55, -1, 55, 36, 4, - 55, -1, 55, -1, 7, -1, 17, -1, 55, 36, - 53, -1, 55, 36, 53, 36, -1, 53, 30, 55, - -1, 55, 4, -1, 4, 55, -1, 5, 55, 55, - -1, 55, 5, 8, 53, -1, 4, -1, 55, -1, - 55, -1, 54, 25, 54, -1, 54, 26, 54, -1, - 54, 18, 54, -1, 54, 19, 54, -1, 54, 20, - 54, -1, 54, 21, 54, -1, 54, 22, 54, -1, - 54, 23, 54, -1, 54, 28, 54, -1, 54, 27, - 54, -1, 54, 29, 54, -1, 54, 30, 54, -1, - 54, 31, 54, -1, 54, 34, 54, 35, 54, -1, - 32, 54, -1, 37, 52, 38, -1, 39, 54, 40, - -1, 56, -1, 3, -1, 27, 3, -1, 12, -1, - 13, 55, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 129, 129, 130, 130, 136, 137, 140, 141, 144, - 145, 146, 147, 148, 149, 150, 153, 154, 155, 158, - 159, 162, 163, 164, 167, 168, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 185, 186, 187, - 189, 191, 193, 195, 197, 199, 205, 205, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 226, 227, 230, 231, 232, - 233 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NUMBER", "MONTH", "WDAY", "COLOR", - "STRING", "IN", "PLUS", "MINUS", "SMALL", "CYEAR", "LEAPYEAR", "SHIFT", - "IF", "LENGTH", "EASTER", "EQ", "NE", "LE", "GE", "LT", "GT", "PASCHA", - "OR", "AND", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "UMINUS", "'?'", - "':'", "'.'", "'['", "']'", "'('", "')'", "$accept", "list", "@1", - "small", "color", "entry", "offset", "conditionaloffset", - "wdaycondition", "length", "date", "reldate", "month", "expr", "pexpr", - "number", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 45, 43, 42, - 47, 37, 33, 282, 63, 58, 46, 91, 93, 40, - 41 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 41, 42, 43, 42, 44, 44, 45, 45, 46, - 46, 46, 46, 46, 46, 46, 47, 47, 47, 48, - 48, 49, 49, 49, 50, 50, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 53, 53, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 55, 55, 56, 56, 56, - 56 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 0, 7, 0, 1, 0, 1, 3, - 3, 4, 3, 4, 6, 5, 0, 2, 2, 0, - 4, 0, 1, 3, 0, 2, 3, 4, 5, 3, - 5, 2, 3, 2, 3, 4, 1, 1, 1, 3, - 4, 3, 2, 2, 3, 4, 1, 1, 1, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 5, 2, 3, 3, 1, 1, 2, 1, - 2 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 5, 1, 6, 7, 8, 0, 7, 3, 0, - 67, 46, 16, 69, 0, 16, 16, 0, 0, 4, - 16, 0, 36, 66, 31, 0, 0, 24, 0, 70, - 24, 24, 68, 0, 0, 0, 48, 19, 0, 33, - 16, 0, 32, 17, 18, 0, 12, 16, 36, 9, - 10, 63, 46, 0, 37, 38, 0, 0, 47, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 65, 21, 24, 29, 34, 0, 24, - 46, 26, 47, 25, 24, 43, 0, 64, 0, 42, - 0, 0, 51, 52, 53, 54, 55, 56, 49, 50, - 58, 57, 59, 60, 61, 0, 22, 0, 11, 0, - 46, 16, 13, 35, 27, 15, 44, 41, 0, 39, - 0, 21, 21, 30, 24, 28, 45, 40, 62, 23, - 20, 14 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 9, 4, 6, 19, 27, 75, 107, 46, - 20, 56, 21, 35, 36, 23 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -88 -static const yytype_int16 yypact[] = -{ - -88, 10, -88, -88, -5, -88, -3, -5, -88, 103, - -88, 122, 36, -88, 122, 13, 13, 11, 15, -88, - 13, -14, 32, -88, 122, 15, 15, 4, 125, -88, - 4, 4, -88, 15, 119, 169, -88, 12, 122, 122, - 145, 144, -88, 210, 210, 15, -88, 13, 37, -88, - -88, 19, 122, 122, -88, -88, 17, 1, 2, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, -88, 52, 4, 29, -88, 147, 4, - 122, 28, -88, 210, 4, -88, 122, -88, 122, -88, - 58, 147, 244, 244, 244, 244, 244, 244, 227, 244, - 83, 83, 19, 19, 19, 192, 47, 61, -88, 122, - -88, 13, -88, -88, 15, -88, -88, -88, 147, 42, - 15, 52, 52, -88, 4, 210, -88, -88, -88, -88, - -88, -88 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -88, -88, -88, -88, 73, -88, -7, -88, -87, -19, - 53, -88, -17, 25, -9, -88 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -48 -static const yytype_int16 yytable[] = -{ - 22, 5, 24, 28, 7, 29, 89, 90, 30, 31, - 2, 49, 50, 37, 32, 42, 38, 57, 10, 48, - 45, 3, 25, 26, 81, 58, 74, 13, 14, 76, - 77, 88, 82, 79, 129, 130, 39, 40, 91, 10, - 84, 39, 17, 85, 86, 25, 26, 33, 13, 14, - 43, 44, 34, 72, 18, 87, 108, 106, 51, 109, - 112, 111, -47, 17, 114, 115, 118, -47, 41, 82, - 83, 113, 121, 41, 119, 18, 122, 116, 127, 117, - 8, 47, 82, 0, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 0, 0, - 123, 126, 0, 0, 124, 131, 10, 11, 12, 82, - 0, 0, 69, 70, 71, 13, 14, 72, 0, 0, - 15, 0, 10, 52, 53, 10, 54, 16, 10, 11, - 17, 13, 14, 0, 13, 14, 55, 13, 14, 125, - 0, 0, 18, 0, 0, 128, 17, 10, 80, 17, - 10, 110, 17, 78, 25, 26, 13, 14, 18, 13, - 14, 18, 0, 0, 18, 0, 0, 0, 0, 0, - 0, 17, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 18, 59, 60, 61, - 62, 63, 64, 0, 65, 66, 67, 68, 69, 70, - 71, 0, 0, 72, 0, 0, 0, 0, 0, 73, - 59, 60, 61, 62, 63, 64, 0, 65, 66, 67, - 68, 69, 70, 71, 0, 0, 72, 120, 59, 60, - 61, 62, 63, 64, 0, 65, 66, 67, 68, 69, - 70, 71, 0, 0, 72, 59, 60, 61, 62, 63, - 64, 0, 0, 66, 67, 68, 69, 70, 71, 0, - 0, 72, 59, 60, 61, 62, 63, 64, 0, 0, - 0, 67, 68, 69, 70, 71, 0, 0, 72 -}; - -static const yytype_int8 yycheck[] = -{ - 9, 6, 11, 12, 7, 14, 4, 5, 15, 16, - 0, 30, 31, 20, 3, 24, 30, 34, 3, 28, - 16, 11, 9, 10, 41, 34, 14, 12, 13, 38, - 39, 30, 41, 40, 121, 122, 4, 5, 36, 3, - 47, 4, 27, 52, 53, 9, 10, 32, 12, 13, - 25, 26, 37, 34, 39, 38, 75, 5, 33, 30, - 79, 78, 30, 27, 36, 84, 8, 30, 36, 78, - 45, 80, 25, 36, 91, 39, 15, 86, 36, 88, - 7, 28, 91, -1, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, -1, -1, - 109, 118, -1, -1, 111, 124, 3, 4, 5, 118, - -1, -1, 29, 30, 31, 12, 13, 34, -1, -1, - 17, -1, 3, 4, 5, 3, 7, 24, 3, 4, - 27, 12, 13, -1, 12, 13, 17, 12, 13, 114, - -1, -1, 39, -1, -1, 120, 27, 3, 4, 27, - 3, 4, 27, 8, 9, 10, 12, 13, 39, 12, - 13, 39, -1, -1, 39, -1, -1, -1, -1, -1, - -1, 27, -1, -1, 27, -1, -1, -1, -1, -1, - -1, -1, -1, 39, -1, -1, 39, 18, 19, 20, - 21, 22, 23, -1, 25, 26, 27, 28, 29, 30, - 31, -1, -1, 34, -1, -1, -1, -1, -1, 40, - 18, 19, 20, 21, 22, 23, -1, 25, 26, 27, - 28, 29, 30, 31, -1, -1, 34, 35, 18, 19, - 20, 21, 22, 23, -1, 25, 26, 27, 28, 29, - 30, 31, -1, -1, 34, 18, 19, 20, 21, 22, - 23, -1, -1, 26, 27, 28, 29, 30, 31, -1, - -1, 34, 18, 19, 20, 21, 22, 23, -1, -1, - -1, 27, 28, 29, 30, 31, -1, -1, 34 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 42, 0, 11, 44, 6, 45, 7, 45, 43, - 3, 4, 5, 12, 13, 17, 24, 27, 39, 46, - 51, 53, 55, 56, 55, 9, 10, 47, 55, 55, - 47, 47, 3, 32, 37, 54, 55, 47, 30, 4, - 5, 36, 55, 54, 54, 16, 50, 51, 55, 50, - 50, 54, 4, 5, 7, 17, 52, 53, 55, 18, - 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, - 30, 31, 34, 40, 14, 48, 55, 55, 8, 47, - 4, 53, 55, 54, 47, 55, 55, 38, 30, 4, - 5, 36, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54, 5, 49, 50, 30, - 4, 53, 50, 55, 36, 50, 55, 55, 8, 53, - 35, 25, 15, 55, 47, 54, 53, 36, 54, 49, - 49, 50 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: -#line 130 "parseholiday.y" - { yacc_stringcolor = (yyvsp[(3) - (5)].ival); - yacc_string = (yyvsp[(4) - (5)].sval); - yacc_daycolor = (yyvsp[(5) - (5)].ival); ;} - break; - - case 4: -#line 133 "parseholiday.y" - { free(yacc_string); ;} - break; - - case 5: -#line 136 "parseholiday.y" - { yacc_small = 0; ;} - break; - - case 6: -#line 137 "parseholiday.y" - { yacc_small = 1; ;} - break; - - case 7: -#line 140 "parseholiday.y" - { (yyval.ival) = 0; ;} - break; - - case 8: -#line 141 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} - break; - - case 9: -#line 144 "parseholiday.y" - { seteaster((yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival), 0); ;} - break; - - case 10: -#line 145 "parseholiday.y" - { seteaster((yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival), 1); ;} - break; - - case 11: -#line 146 "parseholiday.y" - { setdate( m, d, y, (yyvsp[(2) - (4)].ival), (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].ival));;} - break; - - case 12: -#line 147 "parseholiday.y" - { setwday( 0, (yyvsp[(1) - (3)].ival), 0, (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival));;} - break; - - case 13: -#line 148 "parseholiday.y" - { setwday((yyvsp[(1) - (4)].ival), (yyvsp[(2) - (4)].ival), 0, (yyvsp[(3) - (4)].ival), (yyvsp[(4) - (4)].ival));;} - break; - - case 14: -#line 149 "parseholiday.y" - { setwday((yyvsp[(1) - (6)].ival), (yyvsp[(2) - (6)].ival), (yyvsp[(4) - (6)].ival), (yyvsp[(5) - (6)].ival), (yyvsp[(6) - (6)].ival));;} - break; - - case 15: -#line 150 "parseholiday.y" - { setdoff((yyvsp[(1) - (5)].ival), (yyvsp[(2) - (5)].ival),m,d,y,(yyvsp[(4) - (5)].ival),(yyvsp[(5) - (5)].ival));;} - break; - - case 16: -#line 153 "parseholiday.y" - { (yyval.ival) = 0; ;} - break; - - case 17: -#line 154 "parseholiday.y" - { (yyval.ival) = (yyvsp[(2) - (2)].ival); ;} - break; - - case 18: -#line 155 "parseholiday.y" - { (yyval.ival) = -(yyvsp[(2) - (2)].ival); ;} - break; - - case 19: -#line 158 "parseholiday.y" - { (yyval.ival) = 0; ;} - break; - - case 20: -#line 159 "parseholiday.y" - { (yyval.ival) = ((yyvsp[(2) - (4)].ival)<<8) | (yyvsp[(4) - (4)].ival);printf("Shift to %i if %i\n", (yyvsp[(2) - (4)].ival), (yyvsp[(4) - (4)].ival)); ;} - break; - - case 21: -#line 162 "parseholiday.y" - { (yyval.ival) = 0; ;} - break; - - case 22: -#line 163 "parseholiday.y" - { (yyval.ival) = (1<<(yyvsp[(1) - (1)].ival)); ;} - break; - - case 23: -#line 164 "parseholiday.y" - { (yyval.ival) = (1<<(yyvsp[(1) - (3)].ival)) | (yyvsp[(3) - (3)].ival); ;} - break; - - case 24: -#line 167 "parseholiday.y" - { (yyval.ival) = 1; ;} - break; - - case 25: -#line 168 "parseholiday.y" - { (yyval.ival) = (yyvsp[(2) - (2)].ival); ;} - break; - - case 26: -#line 171 "parseholiday.y" - { m = (yyvsp[(3) - (3)].ival); d = (yyvsp[(1) - (3)].ival); y = 0; ;} - break; - - case 27: -#line 172 "parseholiday.y" - { m = (yyvsp[(3) - (4)].ival); d = (yyvsp[(1) - (4)].ival); y = 0; ;} - break; - - case 28: -#line 173 "parseholiday.y" - { m = (yyvsp[(3) - (5)].ival); d = (yyvsp[(1) - (5)].ival); y = (yyvsp[(5) - (5)].ival); ;} - break; - - case 29: -#line 174 "parseholiday.y" - { m = (yyvsp[(1) - (3)].ival); d = (yyvsp[(3) - (3)].ival); y = 0; ;} - break; - - case 30: -#line 175 "parseholiday.y" - { m = (yyvsp[(1) - (5)].ival); d = (yyvsp[(3) - (5)].ival); y = (yyvsp[(5) - (5)].ival); ;} - break; - - case 31: -#line 176 "parseholiday.y" - { m = (yyvsp[(1) - (2)].ival); d = (yyvsp[(2) - (2)].ival); y = 0; ;} - break; - - case 32: -#line 177 "parseholiday.y" - { m = (yyvsp[(1) - (3)].ival); d = (yyvsp[(2) - (3)].ival); y = (yyvsp[(3) - (3)].ival); ;} - break; - - case 33: -#line 178 "parseholiday.y" - { m = (yyvsp[(2) - (2)].ival); d = (yyvsp[(1) - (2)].ival); y = 0; ;} - break; - - case 34: -#line 179 "parseholiday.y" - { m = (yyvsp[(2) - (3)].ival); d = (yyvsp[(1) - (3)].ival); y = (yyvsp[(3) - (3)].ival); ;} - break; - - case 35: -#line 180 "parseholiday.y" - { m = (yyvsp[(3) - (4)].ival); d = (yyvsp[(1) - (4)].ival); y = (yyvsp[(4) - (4)].ival); ;} - break; - - case 36: -#line 181 "parseholiday.y" - { monthday_from_day((yyvsp[(1) - (1)].ival), - &m, &d, &y); ;} - break; - - case 37: -#line 185 "parseholiday.y" - { (yyval.ival) = day_from_name((yyvsp[(1) - (1)].sval)); ;} - break; - - case 38: -#line 186 "parseholiday.y" - { (yyval.ival) = day_from_easter(); ;} - break; - - case 39: -#line 187 "parseholiday.y" - { (yyval.ival) = day_from_monthday - ((yyvsp[(3) - (3)].ival), (yyvsp[(1) - (3)].ival)); ;} - break; - - case 40: -#line 189 "parseholiday.y" - { (yyval.ival) = day_from_monthday - ((yyvsp[(3) - (4)].ival), (yyvsp[(1) - (4)].ival)); ;} - break; - - case 41: -#line 191 "parseholiday.y" - { (yyval.ival) = day_from_monthday - ((yyvsp[(1) - (3)].ival), (yyvsp[(3) - (3)].ival)); ;} - break; - - case 42: -#line 193 "parseholiday.y" - { (yyval.ival) = day_from_monthday - ((yyvsp[(2) - (2)].ival), (yyvsp[(1) - (2)].ival)); ;} - break; - - case 43: -#line 195 "parseholiday.y" - { (yyval.ival) = day_from_monthday - ((yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].ival)); ;} - break; - - case 44: -#line 197 "parseholiday.y" - { (yyval.ival) = day_from_wday((yyvsp[(3) - (3)].ival), (yyvsp[(1) - (3)].ival), - (yyvsp[(2) - (3)].ival) == -1 ? -1 : 0); ;} - break; - - case 45: -#line 199 "parseholiday.y" - { int day=day_from_monthday((yyvsp[(4) - (4)].ival),1); - (yyval.ival) = (yyvsp[(1) - (4)].ival) == 999 - ? day_from_wday(day+1,(yyvsp[(2) - (4)].ival),-1) - : day_from_wday(day,(yyvsp[(2) - (4)].ival),(yyvsp[(1) - (4)].ival)-1);;} - break; - - case 48: -#line 207 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} - break; - - case 49: -#line 208 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) || (yyvsp[(3) - (3)].ival); ;} - break; - - case 50: -#line 209 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) && (yyvsp[(3) - (3)].ival); ;} - break; - - case 51: -#line 210 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) == (yyvsp[(3) - (3)].ival); ;} - break; - - case 52: -#line 211 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) != (yyvsp[(3) - (3)].ival); ;} - break; - - case 53: -#line 212 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) <= (yyvsp[(3) - (3)].ival); ;} - break; - - case 54: -#line 213 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) >= (yyvsp[(3) - (3)].ival); ;} - break; - - case 55: -#line 214 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) < (yyvsp[(3) - (3)].ival); ;} - break; - - case 56: -#line 215 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) > (yyvsp[(3) - (3)].ival); ;} - break; - - case 57: -#line 216 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) + (yyvsp[(3) - (3)].ival); ;} - break; - - case 58: -#line 217 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) - (yyvsp[(3) - (3)].ival); ;} - break; - - case 59: -#line 218 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (3)].ival) * (yyvsp[(3) - (3)].ival); ;} - break; - - case 60: -#line 219 "parseholiday.y" - { (yyval.ival) = (yyvsp[(3) - (3)].ival) ? (yyvsp[(1) - (3)].ival) / (yyvsp[(3) - (3)].ival) : 0; ;} - break; - - case 61: -#line 220 "parseholiday.y" - { (yyval.ival) = (yyvsp[(3) - (3)].ival) ? (yyvsp[(1) - (3)].ival) % (yyvsp[(3) - (3)].ival) : 0; ;} - break; - - case 62: -#line 221 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (5)].ival) ? (yyvsp[(3) - (5)].ival) : (yyvsp[(5) - (5)].ival); ;} - break; - - case 63: -#line 222 "parseholiday.y" - { (yyval.ival) = !(yyvsp[(2) - (2)].ival); ;} - break; - - case 64: -#line 223 "parseholiday.y" - { (yyval.ival) = (yyvsp[(2) - (3)].ival); ;} - break; - - case 65: -#line 226 "parseholiday.y" - { (yyval.ival) = (yyvsp[(2) - (3)].ival); ;} - break; - - case 66: -#line 227 "parseholiday.y" - { (yyval.ival) = (yyvsp[(1) - (1)].ival); ;} - break; - - case 68: -#line 231 "parseholiday.y" - { (yyval.ival) = -(yyvsp[(2) - (2)].ival); ;} - break; - - case 69: -#line 232 "parseholiday.y" - { (yyval.ival) = parse_year; ;} - break; - - case 70: -#line 233 "parseholiday.y" - { (yyval.ival) = !(((yyvsp[(2) - (2)].ival)) & 3); ;} - break; - - -/* Line 1267 of yacc.c. */ -#line 1958 "parseholiday.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -#line 235 "parseholiday.y" - - -/*** Private Yacc callbacks and helper functions ***/ -static void kcalerror(const char *msg) -{ - fprintf(stderr, "%s: %s in line %d of %s\n", progname, - msg, kcallineno+1, filename); - if (!*errormsg) - snprintf(errormsg,sizeof(errormsg), - "Problem with holiday file %s:\n%.80s in line %d", - filename, msg, kcallineno+1); -} - -static time_t date_to_time(int day, int month, int year, - int *wkday, int *julian, int *weeknum) -{ - struct tm tm; - time_t ttime; - - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 0; - tm.tm_mday = day; - tm.tm_mon = month; - tm.tm_year = year; - ttime = tm_to_time(&tm); - if (wkday) - *wkday = tm.tm_wday; - if (julian) - *julian = tm.tm_yday; - if (weeknum) - *weeknum = 0 - ? tm.tm_yday / 7 - : tm.tm_yday ? ((tm.tm_yday - 1) /7) + 1 : 0; - return(ttime == -1 || day != tm.tm_mday ? 0 : ttime); -} - -static time_t tm_to_time(struct tm *tm) -{ - time_t t; /* return value */ - - t = monthbegin[tm->tm_mon] /* full months */ - + tm->tm_mday-1 /* full days */ - + (!(tm->tm_year & 3) && tm->tm_mon > 1); /* leap day this year*/ - tm->tm_yday = t; - t += 365 * (tm->tm_year - 70) /* full years */ - + (tm->tm_year - 69)/4; /* past leap days */ - tm->tm_wday = (t + 4) % 7; - - t = t*86400 + tm->tm_hour*3600 + tm->tm_min*60 + tm->tm_sec; - if (tm->tm_mday > monthlen[tm->tm_mon] + - (!(tm->tm_year & 3) && tm->tm_mon == 1)) - return((time_t)-1); - return(t); -} - -/* - * set holiday by weekday (monday..sunday). The expression is - * "every -th of plus days". num and month - * can be ANY or LAST. - */ - -static void setwday(int num, int wday, int month, int off, int length) -{ - int min_month = 0, max_month = 11; - int min_num = 0, max_num = 4; - int mn, n, dy, l, mlen, wday1; - int ddup = 0; - - if (month != ANY) - min_month = max_month = month-1; - if (month == LAST) - min_month = max_month = 11; - if (num != ANY) - min_num = max_num = num-1; - - holiday_name = yacc_string; - for (mn=min_month; mn <= max_month; mn++) { - (void)date_to_time(1, mn, parse_year, &wday1, 0, 0); - dy = (wday-1 - (wday1-1) +7) % 7 + 1; - mlen = monthlen[mn] + (mn==1 && ISLEAPYEAR(parse_year)); - if (num == LAST) - for (l=0; l < length; l++) - setliteraldate(mn, dy+28<=mlen ? dy+28 : dy+21, - off+l, &ddup); - else - for (dy+=min_num*7, n=min_num; n <= max_num; n++, dy+=7) - if (dy >= 1 && dy <= mlen) - for (l=0; l < length; l++) - setliteraldate(mn,dy,off+l,&ddup); - } -} - -/* - * set holiday by weekday (monday..sunday) date offset. The expression is - * "every before/after plus days". - * (This routine contributed by Peter Littlefield ) - */ - -static void setdoff(int wday, int rel, int month, int day, - int year, int off, int length) -{ - int min_month = 0, max_month = 11; - int min_day = 1, max_day = 31; - int mn, dy, nd, l, wday1; - int ddup = 0; - - if (year != ANY) { - year %= 100; - if (year < 70) year += 100; - if (year != parse_year) - return; - } - if (month != ANY) - min_month = max_month = month-1; - if (month == LAST) - min_month = max_month = 11; - if (day != ANY) - min_day = max_day = day; - - holiday_name = yacc_string; - for (mn=min_month; mn <= max_month; mn++) - if (day == LAST) { - (void)date_to_time(monthlen[mn], mn, parse_year, - &wday1, 0, 0); - nd = (((wday - wday1 + 7) % 7) - - ((rel == BEFORE) ? 7 : 0)) % 7; - for (l=0; l < length; l++) - setliteraldate(mn,monthlen[mn]+nd, off+l, &ddup); - } else - for (dy=min_day; dy <= max_day; dy++) { - (void)date_to_time(dy, mn, parse_year, - &wday1, 0, 0); - nd = (((wday - wday1 + 7) % 7) - - ((rel == BEFORE) ? 7 : 0)) % 7; - for (l=0; l < length; l++) - setliteraldate(mn, dy+nd, off+l, &ddup); - } -} - -static int conditionalOffset( int day, int month, int year, int cond ) -{ - int off = 0; - int wday = 0; - (void)date_to_time( day, month, year, &wday, 0, 0); - if ( wday == 0 ) { wday = 7; } /* sunday is 7, not 0 */ - if ( cond & (1< higher 8 bits contain the possible days to shift to */ - int to = (cond >> 8); - while ( !(to & (1<<((wday+off)%7))) && (off < 8) ) { - ++off; - } - } - if ( off >= 8 ) return 0; - else return off; -} - -/* - * set holiday by date. Ignore holidays in the wrong year. The code is - * complicated by expressions such as "any/last/any" (every last day of - * the month). - */ - -static void setdate(int month, int day, int year, int off, int conditionaloff, int length) -{ - int min_month = 0, max_month = 11; - int min_day = 1, max_day = 31; - int mn, dy, l; - int ddup = 0; - - if (year != ANY) { - year %= 100; - if (year < 70) year += 100; - if (year != parse_year) - return; - } - if (month != ANY) - min_month = max_month = month-1; - if (month == LAST) - min_month = max_month = 11; - if (day != ANY) - min_day = max_day = day; - - holiday_name = yacc_string; - /** TODO: Include the conditionaloff variable. */ - /** The encoding of the conditional offset is: - 8 lower bits: conditions to shift (bit-register, bit 1=mon, ..., bit 7=sun) - 8 higher bits: weekday to shift to (bit-register, bit 1=mon, ..., bit 7=sun) - */ - for (mn=min_month; mn <= max_month; mn++) { - if (day == LAST) { - int newoff = off + conditionalOffset( monthlen[mn], mn, parse_year, conditionaloff ); - for (l=0; l < length; l++) - setliteraldate(mn, monthlen[mn], newoff+l, &ddup); - } else { - for (dy=min_day; dy <= max_day; dy++) { - int newoff = off + conditionalOffset( dy, mn, parse_year, conditionaloff ); - for (l=0; l < length; l++) - setliteraldate(mn, dy, newoff+l, &ddup); - } - } - } -} - - -/* - * After the two routines above have removed ambiguities (ANY) and resolved - * weekday specifications, this routine registers the holiday in the holiday - * array. There are two of these, for full-line holidays (they take away one - * appointment line in the month calendar daybox) and "small" holidays, which - * appear next to the day number. If the day is already some other holiday, - * add a new item to the singly-linked list and insert the holiday there. - * is information stored for parse_holidays(), it - * will free() the holiday name only if its dup field is 0 (because many - * string fields can point to the same string, which was allocated only once - * by the lexer, and should therefore only be freed once). - */ - -static void setliteraldate(int month, int day, int off, int *ddup) -{ - int julian = JULIAN(month, day) + off; - /* struct holiday *hp = yacc_small ? &sm_holiday[julian] - : &holiday[julian]; */ - struct holiday *hp = 0; - - if (julian >= 0 && julian <= 365 ) { - hp = &holidays[julian]; - if ( hp->string ) { - while (hp->next) { hp = hp->next; } - hp->next = malloc( sizeof(struct holiday)*2 ); - hp = hp->next; - hp->next = 0; - } - if (!*ddup) - holiday_name = strdup(holiday_name); - hp->string = holiday_name; - hp->color = (yacc_stringcolor == 0) ? yacc_daycolor : yacc_stringcolor; - hp->dup = (*ddup)++; - - } -} - - -/* - * set a holiday relative to Easter - */ - -static void seteaster(int off, int length, int pascha /*0=Easter, 1=Pascha*/) -{ - int ddup = 0; /* flag for later free() */ - int julian = (pascha ? pascha_julian : easter_julian) + off; - /* struct holiday *hp = yacc_small ? &sm_holiday[julian] - : &holidays[julian];*/ - struct holiday *hp = 0; - - holiday_name = yacc_string; - while (length-- > 0) { - if (julian >= 0 && julian <= 365 ) { - hp = &holidays[julian]; - if ( hp->string ) { - while (hp->next) { hp = hp->next; } - hp->next = malloc( sizeof(struct holiday)*2 ); - hp = hp->next; - hp->next = 0; - } - if (!ddup) - holiday_name = strdup(holiday_name); - hp->string = holiday_name; - hp->color = (yacc_stringcolor == 0) ? yacc_daycolor : yacc_stringcolor; - hp->dup = ddup++; - } - julian++; - } -} - - -/* - * calculate Easter Sunday as a julian date. I got this from Armin Liebl - * , who got it from Knuth. I hope I got - * all this right... - */ - -static int calc_easter(int year) -{ - int golden, cent, grcor, clcor, extra, epact, easter; - - golden = (year/19)*(-19); - golden += year+1; - cent = year/100+1; - grcor = (cent*3)/(-4)+12; - clcor = ((cent-18)/(-25)+cent-16)/3; - extra = (year*5)/4+grcor-10; - epact = golden*11+20+clcor+grcor; - epact += (epact/30)*(-30); - if (epact<=0) - epact += 30; - if (epact==25) { - if (golden>11) - epact += 1; - } else { - if (epact==24) - epact += 1; - } - easter = epact*(-1)+44; - if (easter<21) - easter += 30; - extra += easter; - extra += (extra/7)*(-7); - extra *= -1; - easter += extra+7; - easter += 31+28+!(year&3)-1; - return(easter); -} - - -/* - * set a holiday relative to Pascha, which is the Christian Orthodox Easter. - * Algorithm provided by Efthimios Mavrogeorgiadis . - * Changed 12.9.99 by Efthimios Mavrogeorgiadis . - */ - -static int calc_pascha(int year) /* Pascha in which year? */ -{ - int a = year % 19; - int b = (19 * a + 15) % 30; - int c = (year + (year - (year % 4))/4 + b) % 7; - int dd = b - c; - int e = dd-3 - (2 - (year-(year%100))/100 + (year-(year%400))/400); - int f = (e - (e % 31))/31; - int day = e - 30 * f; - return(31 + 28+!(year&3) + 31 + (f ? 30 : 0) + day-1); -} - - -/* - * functions used for [] syntax: (Erwin Hugo Achermann ) - * - * day_from_name (str) gets day from symbolic name - * day_from_easter () gets day as easter sunday - * day_from_monthday (month, day) gets from - * day_from_wday (day, wday, num) gets num-th day (wday) after day - * monthday_from_day (day, *m, *d, *y) gets month/day/cur_year from - */ - -static int day_from_name(char *str) -{ - int i; - char *name; - - for (i=0; i < 366; i++) { - name = holidays[i].string; - if (name && !strcmp(str, name)) - return(i); - } - return(-1); -} - - -static int day_from_easter(void) -{ - return(easter_julian); -} - - -static int day_from_monthday(int month, int day) -{ - if (month == 13) - return(365 + ISLEAPYEAR(parse_year)); - return(JULIAN(month - 1, day)); -} - - -static void monthday_from_day(int day, int *mn, int *dy, int *yr) -{ - int i, len; - - *yr = parse_year; - *mn = 0; - *dy = 0; - if (day < 0) - return; - for (i=0; i < 12; i++) { - len = monthlen[i] + (i == 1 && ISLEAPYEAR(parse_year)); - if (day < len) { - *mn = i + 1; - *dy = day + 1; - break; - } - day -= len; - } -} - - -static int day_from_wday(int day, int wday, int num) -{ - int wkday, yday, weeknum; - - (void)date_to_time(1, 0, parse_year, &wkday, &yday, &weeknum); - day += (wday - wkday - day + 1001) % 7; - day += num * 7; - return (day); -} - -static void initialize() -{ - register struct holiday *hp; - register int dy; - initialized = 1; - for (hp=holidays, dy=0; dy < 366; dy++, hp++) - { - hp->color = 0; - hp->dup = 0; - hp->string = 0; - hp->next = 0; - } -} - -/*** Public Functions ***/ -/* - * parse the holiday text file, and set up the holiday arrays for a year. - * If year is -1, re-parse the last year parsed (this is used when the - * holiday file changes). If there is a CPP_PATH, check if the executable - * really exists, and if so, pipe the holioday files through it. - * Return an error message if an error occurred, 0 otherwise. - */ - -char *parse_holidays(const char *holidayfile, int year, short force) -{ - extern FILE *kcalin; /* file currently being processed */ - register struct holiday *hp; - register int dy; - short piped = 0; - if (!initialized) - initialize(); - - if (year == parse_year && !force) - return(0); - if (year < 0) - year = parse_year; - parse_year = year; - easter_julian = calc_easter(year + 1900); - pascha_julian = calc_pascha(year + 1900); - - for (hp=holidays, dy=0; dy < 366; dy++, hp++) - { - hp->color = 0; - if (hp->string) { - if (!hp->dup ) - free(hp->string); - hp->string = 0; - } - { - struct holiday *nx = hp->next; - hp->next = 0; - while (nx) { - struct holiday *nxtmp; - if ( nx->string && !nx->dup ) { - free( nx->string ); - } - nxtmp=nx; - nx = nxtmp->next; - free( nxtmp ); - } - } - } - /* for (hp=sm_holiday, d=0; d < 366; d++, hp++) - if (hp->string) { - if (!hp->dup) - free(hp->string); - hp->string = 0; - }*/ - - filename = holidayfile; - if (access(filename, R_OK)) return(0); - kcalin = fopen(filename, "r"); - if (!kcalin) return(0); - *errormsg = 0; - kcallineno = 0; - kcalparse(); - if (piped) pclose(kcalin); - else fclose(kcalin); - if (*errormsg) return(errormsg); - - return(0); -} - diff --git a/kholidays/parseholiday.h b/kholidays/parseholiday.h deleted file mode 100644 index 2f88117b8..000000000 --- a/kholidays/parseholiday.h +++ /dev/null @@ -1,112 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - NUMBER = 258, - MONTH = 259, - WDAY = 260, - COLOR = 261, - STRING = 262, - HOLIDAY_IN = 263, - PLUS = 264, - MINUS = 265, - SMALL = 266, - CYEAR = 267, - LEAPYEAR = 268, - SHIFT = 269, - IF = 270, - LENGTH = 271, - EASTER = 272, - EQ = 273, - NE = 274, - LE = 275, - GE = 276, - LT = 277, - GT = 278, - PASCHA = 279, - OR = 280, - AND = 281, - UMINUS = 282 - }; -#endif -/* Tokens. */ -#define NUMBER 258 -#define MONTH 259 -#define WDAY 260 -#define COLOR 261 -#define STRING 262 -#define HOLIDAY_IN 263 -#define PLUS 264 -#define MINUS 265 -#define SMALL 266 -#define CYEAR 267 -#define LEAPYEAR 268 -#define SHIFT 269 -#define IF 270 -#define LENGTH 271 -#define EASTER 272 -#define EQ 273 -#define NE 274 -#define LE 275 -#define GE 276 -#define LT 277 -#define GT 278 -#define PASCHA 279 -#define OR 280 -#define AND 281 -#define UMINUS 282 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 110 "parseholiday.y" -{ int ival; char *sval; } -/* Line 1529 of yacc.c. */ -#line 105 "parseholiday.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -extern YYSTYPE kcallval; - diff --git a/kholidays/parseholiday.y b/kholidays/parseholiday.y deleted file mode 100644 index 96bf32b77..000000000 --- a/kholidays/parseholiday.y +++ /dev/null @@ -1,718 +0,0 @@ -%{ -/* - * deals with the holiday file. A yacc parser is used to parse the file. - * All the holidays of the specified year are calculated at once and stored - * in two arrays that have one entry for each day of the year. The day - * drawing routines just use the julian date to index into these arrays. - * There are two arrays because holidays can be printed either on a full - * line under the day number, or as a small line to the right of the day - * number. It's convenient to have both. - * - * parse_holidays(year, force) read the holiday file and evaluate - * all the holiday definitions for - * . Sets holiday and sm_holiday - * arrays. If force is set, re-eval even - * if year is the same as last time. - * - * Taken from plan by Thomas Driemeyer - * Adapted for use in KOrganizer by Preston Brown and - * Reinhold Kainhofer - */ - -#include - -#include -#include -#ifdef HAVE_MALLOC_H -# include -#endif -#include -#include -#include -#include -#include -#include - -#include - -/*** Macro definitions and constants ***/ -/* - * Before you mail and complain that the following macro is incorrect, - * please consider that this is one of the main battlegrounds of the - * Annual Usenet Flame Wars. 2000 is a leap year. Just trust me on this :-) - */ - -#define ISLEAPYEAR(y) !((y)&3) -#define JULIAN(m,d) (monthbegin[m] + (d)-1+((m)>1 && ISLEAPYEAR(parse_year))) -#define LAST 999 -#define ANY 0 -#define BEFORE -1 -#define AFTER -2 -/**** Public forward declarations ****/ -char *parse_holidays(const char *holidays, int year, short force); - -/**** Private forward declarations ****/ -extern int kcallex(void); /* external lexical analyzer */ -static void kcalerror(const char *s); -static time_t date_to_time(int day, int month, int year, - int *wkday, int *julian, int *weeknum); -static time_t tm_to_time(struct tm *tm); -static int day_from_name(char *str); -static int day_from_easter(void); -static int day_from_monthday(int month, int day); -static int day_from_wday(int day, int wday, int num); -static void monthday_from_day(int day, int *m, int *d, int *y); -static int calc_easter(int year); -static int calc_pascha(int year); -static void setliteraldate(int month, int day, int off, int *ddup); -static void seteaster(int off, int length, int pascha); -static void setdate(int month, int day, int year, int off, int conditionaloff, int length); -static void setwday(int num, int wday, int month, int off, int length); -static void setdoff(int wday, int rel, int month, int day, - int year, int off, int length); -/*** Variables and structures ***/ -static int m, d, y; -int kcallineno; /* current line # being parsed */ -int yacc_small; /* small string or on its own line? */ -int yacc_stringcolor; /* color of holiday name text, 1..8 */ -char *yacc_string; /* holiday name text */ -int yacc_daycolor; /* color of day number, 1..8 */ -char *progname; /* argv[0] */ -int parse_year = -1; /* year being parsed, 0=1970..99=2069*/ -static const char *filename; /* holiday filename */ -static char errormsg[PATH_MAX+200];/* error message if any, or "" */ -static int easter_julian; /* julian date of Easter Sunday */ -static int pascha_julian; /* julian date of Pascha Sunday */ -static char *holiday_name; /* strdup'd yacc_string */ -short monthlen[12] = { 31, 28, 31, 30, - 31, 30, 31, 31, - 30, 31, 30, 31 }; -short monthbegin[12] = { 0, 31, 59, 90, - 120, 151, 181, - 212, 243, 273, - 304, 334 }; - -/* struct holiday;*/ -struct holiday { - char *string; /* name of holiday, 0=not a holiday */ - int color; - unsigned short dup; /* reference count */ - struct holiday *next; -}; - -struct holiday holidays[366]; /* info for each day, separate for */ -/*struct holiday sm_holiday[366];*/ /* full-line texts under, and small */ - /* texts next to day number */ -static int initialized=0; -%} - -%union { int ival; char *sval; } -%type color offset conditionaloffset length expr pexpr number month reldate wdaycondition -%token NUMBER MONTH WDAY COLOR -%token STRING -%token IN PLUS MINUS SMALL CYEAR LEAPYEAR SHIFT IF -%token LENGTH EASTER EQ NE LE GE LT GT PASCHA - -%left OR -%left AND -%right EQ NE LE GE LT GT -%left '-' '+' -%left '*' '/' '%' -%nonassoc '!' -%nonassoc UMINUS -%left '?' ':' - -%start list - -%% -list : - | list small color STRING color { yacc_stringcolor = $3; - yacc_string = $4; - yacc_daycolor = $5; } - entry { free(yacc_string); } - ; - -small : { yacc_small = 0; } - | SMALL { yacc_small = 1; } - ; - - color : { $$ = 0; } - | COLOR { $$ = $1; } - ; - -entry : EASTER offset length { seteaster($2, $3, 0); } - | PASCHA offset length { seteaster($2, $3, 1); } - | date offset conditionaloffset length { setdate( m, d, y, $2, $3, $4);} - | WDAY offset length { setwday( 0, $1, 0, $2, $3);} - | pexpr WDAY offset length { setwday($1, $2, 0, $3, $4);} - | pexpr WDAY IN month offset length { setwday($1, $2, $4, $5, $6);} - | WDAY pexpr date offset length { setdoff($1, $2,m,d,y,$4,$5);} - ; - - offset : { $$ = 0; } - | PLUS expr { $$ = $2; } - | MINUS expr { $$ = -$2; } - ; - - conditionaloffset : { $$ = 0; } - | SHIFT wdaycondition IF wdaycondition { $$ = ($2<<8) | $4;printf("Shift to %i if %i\n", $2, $4); } - ; - - wdaycondition : { $$ = 0; } - | WDAY { $$ = (1<<$1); } - | WDAY OR wdaycondition { $$ = (1<<$1) | $3; } - ; - - length : { $$ = 1; } - | LENGTH expr { $$ = $2; } - ; - - date : pexpr '.' month { m = $3; d = $1; y = 0; } - | pexpr '.' month '.' { m = $3; d = $1; y = 0; } - | pexpr '.' month '.' expr { m = $3; d = $1; y = $5; } - | month '/' pexpr { m = $1; d = $3; y = 0; } - | month '/' pexpr '/' pexpr { m = $1; d = $3; y = $5; } - | MONTH pexpr { m = $1; d = $2; y = 0; } - | MONTH pexpr pexpr { m = $1; d = $2; y = $3; } - | pexpr MONTH { m = $2; d = $1; y = 0; } - | pexpr MONTH pexpr { m = $2; d = $1; y = $3; } - | pexpr '.' MONTH pexpr { m = $3; d = $1; y = $4; } - | pexpr { monthday_from_day($1, - &m, &d, &y); } - ; - - reldate : STRING { $$ = day_from_name($1); } - | EASTER { $$ = day_from_easter(); } - | pexpr '.' month { $$ = day_from_monthday - ($3, $1); } - | pexpr '.' month '.' { $$ = day_from_monthday - ($3, $1); } - | month '/' pexpr { $$ = day_from_monthday - ($1, $3); } - | pexpr MONTH { $$ = day_from_monthday - ($2, $1); } - | MONTH pexpr { $$ = day_from_monthday - ($1, $2); } - | WDAY pexpr pexpr { $$ = day_from_wday($3, $1, - $2 == -1 ? -1 : 0); } - | pexpr WDAY IN month { int day=day_from_monthday($4,1); - $$ = $1 == 999 - ? day_from_wday(day+1,$2,-1) - : day_from_wday(day,$2,$1-1);} - ; - - month : MONTH | pexpr; - - expr : pexpr { $$ = $1; } - | expr OR expr { $$ = $1 || $3; } - | expr AND expr { $$ = $1 && $3; } - | expr EQ expr { $$ = $1 == $3; } - | expr NE expr { $$ = $1 != $3; } - | expr LE expr { $$ = $1 <= $3; } - | expr GE expr { $$ = $1 >= $3; } - | expr LT expr { $$ = $1 < $3; } - | expr GT expr { $$ = $1 > $3; } - | expr '+' expr { $$ = $1 + $3; } - | expr '-' expr { $$ = $1 - $3; } - | expr '*' expr { $$ = $1 * $3; } - | expr '/' expr { $$ = $3 ? $1 / $3 : 0; } - | expr '%' expr { $$ = $3 ? $1 % $3 : 0; } - | expr '?' expr ':' expr { $$ = $1 ? $3 : $5; } - | '!' expr { $$ = !$2; } - | '[' reldate ']' { $$ = $2; } - ; - - pexpr : '(' expr ')' { $$ = $2; } - | number { $$ = $1; } - ; - - number : NUMBER - | '-' NUMBER %prec UMINUS { $$ = -$2; } - | CYEAR { $$ = parse_year; } - | LEAPYEAR pexpr { $$ = !(($2) & 3); } - ; -%% - -/*** Private Yacc callbacks and helper functions ***/ -static void kcalerror(const char *msg) -{ - fprintf(stderr, "%s: %s in line %d of %s\n", progname, - msg, kcallineno+1, filename); - if (!*errormsg) - snprintf(errormsg,sizeof(errormsg), - "Problem with holiday file %s:\n%.80s in line %d", - filename, msg, kcallineno+1); -} - -static time_t date_to_time(int day, int month, int year, - int *wkday, int *julian, int *weeknum) -{ - struct tm tm; - time_t ttime; - - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 0; - tm.tm_mday = day; - tm.tm_mon = month; - tm.tm_year = year; - ttime = tm_to_time(&tm); - if (wkday) - *wkday = tm.tm_wday; - if (julian) - *julian = tm.tm_yday; - if (weeknum) - *weeknum = 0 - ? tm.tm_yday / 7 - : tm.tm_yday ? ((tm.tm_yday - 1) /7) + 1 : 0; - return(ttime == -1 || day != tm.tm_mday ? 0 : ttime); -} - -static time_t tm_to_time(struct tm *tm) -{ - time_t t; /* return value */ - - t = monthbegin[tm->tm_mon] /* full months */ - + tm->tm_mday-1 /* full days */ - + (!(tm->tm_year & 3) && tm->tm_mon > 1); /* leap day this year*/ - tm->tm_yday = t; - t += 365 * (tm->tm_year - 70) /* full years */ - + (tm->tm_year - 69)/4; /* past leap days */ - tm->tm_wday = (t + 4) % 7; - - t = t*86400 + tm->tm_hour*3600 + tm->tm_min*60 + tm->tm_sec; - if (tm->tm_mday > monthlen[tm->tm_mon] + - (!(tm->tm_year & 3) && tm->tm_mon == 1)) - return((time_t)-1); - return(t); -} - -/* - * set holiday by weekday (monday..sunday). The expression is - * "every -th of plus days". num and month - * can be ANY or LAST. - */ - -static void setwday(int num, int wday, int month, int off, int length) -{ - int min_month = 0, max_month = 11; - int min_num = 0, max_num = 4; - int mn, n, dy, l, mlen, wday1; - int ddup = 0; - - if (month != ANY) - min_month = max_month = month-1; - if (month == LAST) - min_month = max_month = 11; - if (num != ANY) - min_num = max_num = num-1; - - holiday_name = yacc_string; - for (mn=min_month; mn <= max_month; mn++) { - (void)date_to_time(1, mn, parse_year, &wday1, 0, 0); - dy = (wday-1 - (wday1-1) +7) % 7 + 1; - mlen = monthlen[mn] + (mn==1 && ISLEAPYEAR(parse_year)); - if (num == LAST) - for (l=0; l < length; l++) - setliteraldate(mn, dy+28<=mlen ? dy+28 : dy+21, - off+l, &ddup); - else - for (dy+=min_num*7, n=min_num; n <= max_num; n++, dy+=7) - if (dy >= 1 && dy <= mlen) - for (l=0; l < length; l++) - setliteraldate(mn,dy,off+l,&ddup); - } -} - -/* - * set holiday by weekday (monday..sunday) date offset. The expression is - * "every before/after plus days". - * (This routine contributed by Peter Littlefield ) - */ - -static void setdoff(int wday, int rel, int month, int day, - int year, int off, int length) -{ - int min_month = 0, max_month = 11; - int min_day = 1, max_day = 31; - int mn, dy, nd, l, wday1; - int ddup = 0; - - if (year != ANY) { - year %= 100; - if (year < 70) year += 100; - if (year != parse_year) - return; - } - if (month != ANY) - min_month = max_month = month-1; - if (month == LAST) - min_month = max_month = 11; - if (day != ANY) - min_day = max_day = day; - - holiday_name = yacc_string; - for (mn=min_month; mn <= max_month; mn++) - if (day == LAST) { - (void)date_to_time(monthlen[mn], mn, parse_year, - &wday1, 0, 0); - nd = (((wday - wday1 + 7) % 7) - - ((rel == BEFORE) ? 7 : 0)) % 7; - for (l=0; l < length; l++) - setliteraldate(mn,monthlen[mn]+nd, off+l, &ddup); - } else - for (dy=min_day; dy <= max_day; dy++) { - (void)date_to_time(dy, mn, parse_year, - &wday1, 0, 0); - nd = (((wday - wday1 + 7) % 7) - - ((rel == BEFORE) ? 7 : 0)) % 7; - for (l=0; l < length; l++) - setliteraldate(mn, dy+nd, off+l, &ddup); - } -} - -static int conditionalOffset( int day, int month, int year, int cond ) -{ - int off = 0; - int wday = 0; - (void)date_to_time( day, month, year, &wday, 0, 0); - if ( wday == 0 ) { wday = 7; } /* sunday is 7, not 0 */ - if ( cond & (1< higher 8 bits contain the possible days to shift to */ - int to = (cond >> 8); - while ( !(to & (1<<((wday+off)%7))) && (off < 8) ) { - ++off; - } - } - if ( off >= 8 ) return 0; - else return off; -} - -/* - * set holiday by date. Ignore holidays in the wrong year. The code is - * complicated by expressions such as "any/last/any" (every last day of - * the month). - */ - -static void setdate(int month, int day, int year, int off, int conditionaloff, int length) -{ - int min_month = 0, max_month = 11; - int min_day = 1, max_day = 31; - int mn, dy, l; - int ddup = 0; - - if (year != ANY) { - year %= 100; - if (year < 70) year += 100; - if (year != parse_year) - return; - } - if (month != ANY) - min_month = max_month = month-1; - if (month == LAST) - min_month = max_month = 11; - if (day != ANY) - min_day = max_day = day; - - holiday_name = yacc_string; - /** TODO: Include the conditionaloff variable. */ - /** The encoding of the conditional offset is: - 8 lower bits: conditions to shift (bit-register, bit 1=mon, ..., bit 7=sun) - 8 higher bits: weekday to shift to (bit-register, bit 1=mon, ..., bit 7=sun) - */ - for (mn=min_month; mn <= max_month; mn++) { - if (day == LAST) { - int newoff = off + conditionalOffset( monthlen[mn], mn, parse_year, conditionaloff ); - for (l=0; l < length; l++) - setliteraldate(mn, monthlen[mn], newoff+l, &ddup); - } else { - for (dy=min_day; dy <= max_day; dy++) { - int newoff = off + conditionalOffset( dy, mn, parse_year, conditionaloff ); - for (l=0; l < length; l++) - setliteraldate(mn, dy, newoff+l, &ddup); - } - } - } -} - - -/* - * After the two routines above have removed ambiguities (ANY) and resolved - * weekday specifications, this routine registers the holiday in the holiday - * array. There are two of these, for full-line holidays (they take away one - * appointment line in the month calendar daybox) and "small" holidays, which - * appear next to the day number. If the day is already some other holiday, - * add a new item to the singly-linked list and insert the holiday there. - * is information stored for parse_holidays(), it - * will free() the holiday name only if its dup field is 0 (because many - * string fields can point to the same string, which was allocated only once - * by the lexer, and should therefore only be freed once). - */ - -static void setliteraldate(int month, int day, int off, int *ddup) -{ - int julian = JULIAN(month, day) + off; - /* struct holiday *hp = yacc_small ? &sm_holiday[julian] - : &holiday[julian]; */ - struct holiday *hp = 0; - - if (julian >= 0 && julian <= 365 ) { - hp = &holidays[julian]; - if ( hp->string ) { - while (hp->next) { hp = hp->next; } - hp->next = malloc( sizeof(struct holiday)*2 ); - hp = hp->next; - hp->next = 0; - } - if (!*ddup) - holiday_name = strdup(holiday_name); - hp->string = holiday_name; - hp->color = (yacc_stringcolor == 0) ? yacc_daycolor : yacc_stringcolor; - hp->dup = (*ddup)++; - - } -} - - -/* - * set a holiday relative to Easter - */ - -static void seteaster(int off, int length, int pascha /*0=Easter, 1=Pascha*/) -{ - int ddup = 0; /* flag for later free() */ - int julian = (pascha ? pascha_julian : easter_julian) + off; - /* struct holiday *hp = yacc_small ? &sm_holiday[julian] - : &holidays[julian];*/ - struct holiday *hp = 0; - - holiday_name = yacc_string; - while (length-- > 0) { - if (julian >= 0 && julian <= 365 ) { - hp = &holidays[julian]; - if ( hp->string ) { - while (hp->next) { hp = hp->next; } - hp->next = malloc( sizeof(struct holiday)*2 ); - hp = hp->next; - hp->next = 0; - } - if (!ddup) - holiday_name = strdup(holiday_name); - hp->string = holiday_name; - hp->color = (yacc_stringcolor == 0) ? yacc_daycolor : yacc_stringcolor; - hp->dup = ddup++; - } - julian++; - } -} - - -/* - * calculate Easter Sunday as a julian date. I got this from Armin Liebl - * , who got it from Knuth. I hope I got - * all this right... - */ - -static int calc_easter(int year) -{ - int golden, cent, grcor, clcor, extra, epact, easter; - - golden = (year/19)*(-19); - golden += year+1; - cent = year/100+1; - grcor = (cent*3)/(-4)+12; - clcor = ((cent-18)/(-25)+cent-16)/3; - extra = (year*5)/4+grcor-10; - epact = golden*11+20+clcor+grcor; - epact += (epact/30)*(-30); - if (epact<=0) - epact += 30; - if (epact==25) { - if (golden>11) - epact += 1; - } else { - if (epact==24) - epact += 1; - } - easter = epact*(-1)+44; - if (easter<21) - easter += 30; - extra += easter; - extra += (extra/7)*(-7); - extra *= -1; - easter += extra+7; - easter += 31+28+!(year&3)-1; - return(easter); -} - - -/* - * set a holiday relative to Pascha, which is the Christian Orthodox Easter. - * Algorithm provided by Efthimios Mavrogeorgiadis . - * Changed 12.9.99 by Efthimios Mavrogeorgiadis . - */ - -static int calc_pascha(int year) /* Pascha in which year? */ -{ - int a = year % 19; - int b = (19 * a + 15) % 30; - int c = (year + (year - (year % 4))/4 + b) % 7; - int dd = b - c; - int e = dd-3 - (2 - (year-(year%100))/100 + (year-(year%400))/400); - int f = (e - (e % 31))/31; - int day = e - 30 * f; - return(31 + 28+!(year&3) + 31 + (f ? 30 : 0) + day-1); -} - - -/* - * functions used for [] syntax: (Erwin Hugo Achermann ) - * - * day_from_name (str) gets day from symbolic name - * day_from_easter () gets day as easter sunday - * day_from_monthday (month, day) gets from - * day_from_wday (day, wday, num) gets num-th day (wday) after day - * monthday_from_day (day, *m, *d, *y) gets month/day/cur_year from - */ - -static int day_from_name(char *str) -{ - int i; - char *name; - - for (i=0; i < 366; i++) { - name = holidays[i].string; - if (name && !strcmp(str, name)) - return(i); - } - return(-1); -} - - -static int day_from_easter(void) -{ - return(easter_julian); -} - - -static int day_from_monthday(int month, int day) -{ - if (month == 13) - return(365 + ISLEAPYEAR(parse_year)); - return(JULIAN(month - 1, day)); -} - - -static void monthday_from_day(int day, int *mn, int *dy, int *yr) -{ - int i, len; - - *yr = parse_year; - *mn = 0; - *dy = 0; - if (day < 0) - return; - for (i=0; i < 12; i++) { - len = monthlen[i] + (i == 1 && ISLEAPYEAR(parse_year)); - if (day < len) { - *mn = i + 1; - *dy = day + 1; - break; - } - day -= len; - } -} - - -static int day_from_wday(int day, int wday, int num) -{ - int wkday, yday, weeknum; - - (void)date_to_time(1, 0, parse_year, &wkday, &yday, &weeknum); - day += (wday - wkday - day + 1001) % 7; - day += num * 7; - return (day); -} - -static void initialize() -{ - register struct holiday *hp; - register int dy; - initialized = 1; - for (hp=holidays, dy=0; dy < 366; dy++, hp++) - { - hp->color = 0; - hp->dup = 0; - hp->string = 0; - hp->next = 0; - } -} - -/*** Public Functions ***/ -/* - * parse the holiday text file, and set up the holiday arrays for a year. - * If year is -1, re-parse the last year parsed (this is used when the - * holiday file changes). If there is a CPP_PATH, check if the executable - * really exists, and if so, pipe the holioday files through it. - * Return an error message if an error occurred, 0 otherwise. - */ - -char *parse_holidays(const char *holidayfile, int year, short force) -{ - extern FILE *kcalin; /* file currently being processed */ - register struct holiday *hp; - register int dy; - short piped = 0; - if (!initialized) - initialize(); - - if (year == parse_year && !force) - return(0); - if (year < 0) - year = parse_year; - parse_year = year; - easter_julian = calc_easter(year + 1900); - pascha_julian = calc_pascha(year + 1900); - - for (hp=holidays, dy=0; dy < 366; dy++, hp++) - { - hp->color = 0; - if (hp->string) { - if (!hp->dup ) - free(hp->string); - hp->string = 0; - } - { - struct holiday *nx = hp->next; - hp->next = 0; - while (nx) { - struct holiday *nxtmp; - if ( nx->string && !nx->dup ) { - free( nx->string ); - } - nxtmp=nx; - nx = nxtmp->next; - free( nxtmp ); - } - } - } - /* for (hp=sm_holiday, d=0; d < 366; d++, hp++) - if (hp->string) { - if (!hp->dup) - free(hp->string); - hp->string = 0; - }*/ - - filename = holidayfile; - if (access(filename, R_OK)) return(0); - kcalin = fopen(filename, "r"); - if (!kcalin) return(0); - *errormsg = 0; - kcallineno = 0; - kcalparse(); - if (piped) pclose(kcalin); - else fclose(kcalin); - if (*errormsg) return(errormsg); - - return(0); -} diff --git a/kholidays/scanholiday.c b/kholidays/scanholiday.c deleted file mode 100644 index f7042cbcf..000000000 --- a/kholidays/scanholiday.c +++ /dev/null @@ -1,2038 +0,0 @@ -#define yy_create_buffer kcal_create_buffer -#define yy_delete_buffer kcal_delete_buffer -#define yy_scan_buffer kcal_scan_buffer -#define yy_scan_string kcal_scan_string -#define yy_scan_bytes kcal_scan_bytes -#define yy_flex_debug kcal_flex_debug -#define yy_init_buffer kcal_init_buffer -#define yy_flush_buffer kcal_flush_buffer -#define yy_load_buffer_state kcal_load_buffer_state -#define yy_switch_to_buffer kcal_switch_to_buffer -#define yyin kcalin -#define yyleng kcalleng -#define yylex kcallex -#define yyout kcalout -#define yyrestart kcalrestart -#define yytext kcaltext - -#line 19 "scanholiday.c" -/* A lexical scanner generated by flex*/ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* Some routines like yy_flex_realloc() are emitted as static but are - not called by all lexers. This generates warnings in some compilers, - notably GCC. Arrange to suppress these. */ -#ifdef __GNUC__ -#define YY_MAY_BE_UNUSED __attribute__((unused)) -#else -#define YY_MAY_BE_UNUSED -#endif - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define yywrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 69 -#define YY_END_OF_BUFFER 70 -static yyconst short int yy_accept[280] = - { 0, - 0, 0, 70, 68, 3, 3, 4, 68, 68, 4, - 68, 33, 33, 33, 33, 33, 33, 64, 68, 65, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 4, 61, 0, 34, 0, 1, 66, 33, 0, 0, - 0, 0, 0, 62, 60, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 41, 40, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 39, 0, 0, 0, 0, 67, 0, - - 2, 24, 25, 26, 27, 28, 0, 30, 0, 0, - 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 9, 0, 0, 0, 0, 0, 0, 52, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, - 57, 37, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 11, 10, 29, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 45, 0, 32, - - 8, 0, 0, 51, 0, 0, 35, 0, 0, 0, - 53, 0, 0, 0, 0, 7, 43, 0, 0, 0, - 0, 0, 0, 0, 50, 44, 0, 0, 0, 0, - 0, 58, 0, 12, 31, 0, 47, 0, 21, 0, - 0, 49, 0, 17, 0, 0, 48, 0, 0, 23, - 0, 0, 0, 0, 54, 0, 0, 5, 0, 56, - 0, 14, 0, 0, 0, 18, 0, 59, 16, 6, - 46, 15, 22, 0, 20, 0, 13, 19, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 6, 1, 7, 8, 1, 7, - 7, 7, 7, 1, 7, 7, 7, 9, 10, 11, - 12, 13, 14, 9, 9, 9, 9, 15, 1, 16, - 17, 18, 7, 1, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 1, 35, 36, 37, 38, 39, 40, 1, 41, 1, - 7, 1, 7, 1, 1, 1, 19, 20, 21, 22, - - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 1, 35, 36, 37, 38, 39, 40, 1, - 41, 1, 1, 42, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[43] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 1 - } ; - -static yyconst short int yy_base[284] = - { 0, - 0, 292, 306, 308, 308, 308, 288, 299, 300, 308, - 294, 34, 265, 17, 15, 18, 263, 282, 281, 280, - 28, 33, 255, 38, 39, 41, 260, 35, 46, 50, - 52, 261, 49, 53, 270, 63, 54, 65, 269, 249, - 287, 308, 284, 308, 285, 308, 308, 86, 250, 264, - 263, 258, 257, 308, 308, 308, 245, 240, 245, 254, - 254, 71, 258, 235, 254, 238, 250, 252, 69, 233, - 243, 246, 308, 308, 236, 45, 231, 83, 78, 234, - 233, 225, 226, 308, 226, 223, 238, 222, 84, 231, - 238, 224, 79, 308, 232, 85, 227, 91, 308, 250, - - 308, 308, 308, 308, 308, 308, 229, 308, 224, 212, - 216, 227, 224, 214, 209, 221, 206, 207, 206, 203, - 203, 203, 215, 213, 197, 193, 210, 195, 197, 205, - 206, 207, 308, 189, 204, 202, 191, 202, 186, 308, - 183, 187, 182, 194, 187, 194, 180, 179, 177, 180, - 182, 173, 174, 178, 172, 176, 169, 169, 174, 308, - 308, 308, 171, 178, 159, 161, 172, 160, 159, 176, - 162, 174, 308, 308, 308, 151, 154, 158, 163, 152, - 168, 155, 165, 158, 308, 148, 150, 158, 143, 149, - 159, 155, 140, 153, 151, 150, 149, 308, 138, 308, - - 308, 133, 146, 308, 148, 132, 308, 147, 139, 123, - 308, 128, 139, 135, 123, 308, 308, 118, 138, 134, - 137, 133, 132, 122, 308, 308, 111, 129, 131, 113, - 116, 308, 107, 308, 308, 123, 308, 110, 308, 103, - 124, 308, 123, 308, 118, 105, 308, 120, 118, 308, - 118, 95, 113, 112, 308, 98, 91, 308, 96, 308, - 95, 308, 88, 105, 79, 308, 97, 308, 308, 308, - 308, 308, 308, 79, 308, 71, 308, 308, 308, 121, - 123, 109, 125 - } ; - -static yyconst short int yy_def[284] = - { 0, - 279, 1, 279, 279, 279, 279, 279, 280, 281, 279, - 279, 279, 282, 282, 282, 282, 16, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 283, 279, 280, 279, 281, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 283, - - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 0, 279, - 279, 279, 279 - } ; - -static yyconst short int yy_nxt[351] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 10, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 4, 28, 29, 4, 30, - 31, 32, 33, 34, 35, 36, 37, 4, 4, 38, - 39, 40, 48, 48, 48, 48, 48, 48, 50, 51, - 279, 57, 279, 279, 52, 61, 64, 66, 73, 58, - 65, 59, 62, 68, 75, 60, 74, 69, 77, 83, - 79, 85, 78, 70, 126, 71, 127, 67, 80, 93, - 84, 88, 86, 76, 81, 89, 94, 96, 90, 112, - 97, 95, 120, 91, 48, 48, 48, 48, 48, 48, - - 92, 129, 131, 121, 142, 147, 150, 151, 113, 153, - 48, 278, 132, 277, 130, 276, 148, 143, 133, 275, - 154, 43, 43, 45, 45, 100, 100, 274, 273, 272, - 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, - 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, - 251, 250, 249, 103, 248, 247, 246, 245, 244, 243, - 242, 241, 240, 239, 105, 238, 237, 236, 235, 234, - 233, 232, 231, 230, 229, 228, 104, 227, 226, 225, - 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, - 214, 213, 212, 211, 210, 209, 102, 106, 208, 207, - - 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, - 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, - 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 101, 152, 149, 146, 145, 144, 141, 140, - 139, 138, 137, 136, 135, 134, 128, 125, 124, 123, - 122, 119, 118, 117, 116, 115, 114, 111, 110, 109, - 108, 107, 106, 105, 104, 103, 102, 46, 44, 101, - 99, 98, 87, 82, 72, 63, 56, 55, 54, 53, - - 49, 47, 46, 44, 42, 279, 41, 3, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279 - } ; - -static yyconst short int yy_chk[351] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 12, 12, 12, 12, 12, 12, 14, 15, - 15, 21, 14, 16, 16, 22, 24, 25, 28, 21, - 24, 21, 22, 26, 29, 21, 28, 26, 30, 33, - 31, 34, 30, 26, 76, 26, 76, 25, 31, 37, - 33, 36, 34, 29, 31, 36, 37, 38, 36, 62, - 38, 37, 69, 36, 48, 48, 48, 48, 48, 48, - - 36, 78, 79, 69, 89, 93, 96, 96, 62, 98, - 282, 276, 79, 274, 78, 267, 93, 89, 79, 265, - 98, 280, 280, 281, 281, 283, 283, 264, 263, 261, - 259, 257, 256, 254, 253, 252, 251, 249, 248, 246, - 245, 243, 241, 240, 238, 236, 233, 231, 230, 229, - 228, 227, 224, 223, 222, 221, 220, 219, 218, 215, - 214, 213, 212, 210, 209, 208, 206, 205, 203, 202, - 199, 197, 196, 195, 194, 193, 192, 191, 190, 189, - 188, 187, 186, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 172, 171, 170, 169, 168, 167, 166, 165, - - 164, 163, 159, 158, 157, 156, 155, 154, 153, 152, - 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, - 141, 139, 138, 137, 136, 135, 134, 132, 131, 130, - 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, - 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, - 109, 107, 100, 97, 95, 92, 91, 90, 88, 87, - 86, 85, 83, 82, 81, 80, 77, 75, 72, 71, - 70, 68, 67, 66, 65, 64, 63, 61, 60, 59, - 58, 57, 53, 52, 51, 50, 49, 45, 43, 41, - 40, 39, 35, 32, 27, 23, 20, 19, 18, 17, - - 13, 11, 9, 8, 7, 3, 2, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "scanholiday.lex" -#define INITIAL 0 -#line 2 "scanholiday.lex" -#include -#include -#include "parseholiday.h" -#define YY_NO_UNPUT -#define YY_MAIN 0 -#define YY_NEVER_INTERACTIVE 1 -#define YY_ALWAYS_INTERACTIVE 0 -#define YY_STACK_USED 0 -#line 568 "scanholiday.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; - register int yy_act; - -#line 13 "scanholiday.lex" - - -#line 725 "scanholiday.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 280 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_current_state != 279 ); - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 15 "scanholiday.lex" -; - YY_BREAK -case 2: -YY_RULE_SETUP -#line 16 "scanholiday.lex" -; - YY_BREAK -case 3: -YY_RULE_SETUP -#line 17 "scanholiday.lex" -; - YY_BREAK -case 4: -YY_RULE_SETUP -#line 18 "scanholiday.lex" -{ return(*kcaltext); } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 20 "scanholiday.lex" -{ kcallval.ival = 1; return(MONTH); } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 21 "scanholiday.lex" -{ kcallval.ival = 2; return(MONTH); } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 22 "scanholiday.lex" -{ kcallval.ival = 3; return(MONTH); } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 23 "scanholiday.lex" -{ kcallval.ival = 4; return(MONTH); } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 24 "scanholiday.lex" -{ kcallval.ival = 5; return(MONTH); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 25 "scanholiday.lex" -{ kcallval.ival = 6; return(MONTH); } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 26 "scanholiday.lex" -{ kcallval.ival = 7; return(MONTH); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 27 "scanholiday.lex" -{ kcallval.ival = 8; return(MONTH); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 28 "scanholiday.lex" -{ kcallval.ival = 9; return(MONTH); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 29 "scanholiday.lex" -{ kcallval.ival = 10; return(MONTH); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 30 "scanholiday.lex" -{ kcallval.ival = 11; return(MONTH); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 31 "scanholiday.lex" -{ kcallval.ival = 12; return(MONTH); } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 33 "scanholiday.lex" -{ kcallval.ival = 1; return(WDAY); } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 34 "scanholiday.lex" -{ kcallval.ival = 2; return(WDAY); } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 35 "scanholiday.lex" -{ kcallval.ival = 3; return(WDAY); } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 36 "scanholiday.lex" -{ kcallval.ival = 4; return(WDAY); } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 37 "scanholiday.lex" -{ kcallval.ival = 5; return(WDAY); } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 38 "scanholiday.lex" -{ kcallval.ival = 6; return(WDAY); } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 39 "scanholiday.lex" -{ kcallval.ival = 7; return(WDAY); } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 41 "scanholiday.lex" -{ kcallval.ival = 1; return(NUMBER); } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 42 "scanholiday.lex" -{ kcallval.ival = 2; return(NUMBER); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 43 "scanholiday.lex" -{ kcallval.ival = 3; return(NUMBER); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 44 "scanholiday.lex" -{ kcallval.ival = 4; return(NUMBER); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 45 "scanholiday.lex" -{ kcallval.ival = 5; return(NUMBER); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 46 "scanholiday.lex" -{ kcallval.ival = 999; return(NUMBER); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 47 "scanholiday.lex" -{ kcallval.ival = 0; return(NUMBER); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 49 "scanholiday.lex" -{ kcallval.ival = -1; return(NUMBER); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 50 "scanholiday.lex" -{ kcallval.ival = -2; return(NUMBER); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 52 "scanholiday.lex" -{ kcallval.ival = atoi(kcaltext); return(NUMBER); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 54 "scanholiday.lex" -{ kcallval.sval = strdup(kcaltext+1); - kcallval.sval[strlen(kcallval.sval)-1] = 0; - return(STRING); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 58 "scanholiday.lex" -; - YY_BREAK -case 36: -YY_RULE_SETUP -#line 59 "scanholiday.lex" -; - YY_BREAK -case 37: -YY_RULE_SETUP -#line 60 "scanholiday.lex" -; - YY_BREAK -case 38: -YY_RULE_SETUP -#line 61 "scanholiday.lex" -; - YY_BREAK -case 39: -YY_RULE_SETUP -#line 62 "scanholiday.lex" -; - YY_BREAK -case 40: -YY_RULE_SETUP -#line 63 "scanholiday.lex" -{ return(HOLIDAY_IN); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 64 "scanholiday.lex" -{ return(IF); } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 65 "scanholiday.lex" -{ return(PLUS); } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 66 "scanholiday.lex" -{ return(MINUS); } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 67 "scanholiday.lex" -{ return(SMALL); } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 68 "scanholiday.lex" -{ return(CYEAR); } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 69 "scanholiday.lex" -{ return(LEAPYEAR); } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 70 "scanholiday.lex" -{ return(EASTER); } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 71 "scanholiday.lex" -{ return(PASCHA); } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 72 "scanholiday.lex" -{ return(LENGTH); } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 73 "scanholiday.lex" -{ return(SHIFT); } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 75 "scanholiday.lex" -{ kcallval.ival = 1; return(COLOR); } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 76 "scanholiday.lex" -{ kcallval.ival = 2; return(COLOR); } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 77 "scanholiday.lex" -{ kcallval.ival = 3; return(COLOR); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 78 "scanholiday.lex" -{ kcallval.ival = 4; return(COLOR); } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 79 "scanholiday.lex" -{ kcallval.ival = 5; return(COLOR); } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 80 "scanholiday.lex" -{ kcallval.ival = 6; return(COLOR); } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 81 "scanholiday.lex" -{ kcallval.ival = 7; return(COLOR); } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 82 "scanholiday.lex" -{ kcallval.ival = 8; return(COLOR); } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 83 "scanholiday.lex" -{ kcallval.ival = 9; return(COLOR); } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 85 "scanholiday.lex" -{ return(EQ); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 86 "scanholiday.lex" -{ return(NE); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 87 "scanholiday.lex" -{ return(LE); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 88 "scanholiday.lex" -{ return(GE); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 89 "scanholiday.lex" -{ return(LT); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 90 "scanholiday.lex" -{ return(GT); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 91 "scanholiday.lex" -{ return(AND);} - YY_BREAK -case 67: -YY_RULE_SETUP -#line 92 "scanholiday.lex" -{ return(OR); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 94 "scanholiday.lex" -{ printf("holiday: bad char: %s \n", kcaltext); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 96 "scanholiday.lex" -ECHO; - YY_BREAK -#line 1152 "scanholiday.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 280 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 280 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 279); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - - return c; - } -#endif /* YY_NO_INPUT */ - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 96 "scanholiday.lex" - diff --git a/kholidays/scanholiday.lex b/kholidays/scanholiday.lex deleted file mode 100644 index acbe9f25e..000000000 --- a/kholidays/scanholiday.lex +++ /dev/null @@ -1,97 +0,0 @@ -%{ -#include -#include -#include "parseholiday.h" -#define YY_NO_UNPUT -%} - -%option nomain -%option noyywrap -%option never-interactive -%option noalways-interactive -%option nostack - -%% - -#.*\n ; -^:.*\n ; -[ \t\r\n] ; -[-+*/%.!?:()\[\]] { return(*kcaltext); } - -january { kcallval.ival = 1; return(MONTH); } -february { kcallval.ival = 2; return(MONTH); } -march { kcallval.ival = 3; return(MONTH); } -april { kcallval.ival = 4; return(MONTH); } -may { kcallval.ival = 5; return(MONTH); } -june { kcallval.ival = 6; return(MONTH); } -july { kcallval.ival = 7; return(MONTH); } -august { kcallval.ival = 8; return(MONTH); } -september { kcallval.ival = 9; return(MONTH); } -october { kcallval.ival = 10; return(MONTH); } -november { kcallval.ival = 11; return(MONTH); } -december { kcallval.ival = 12; return(MONTH); } - -monday { kcallval.ival = 1; return(WDAY); } -tuesday { kcallval.ival = 2; return(WDAY); } -wednesday { kcallval.ival = 3; return(WDAY); } -thursday { kcallval.ival = 4; return(WDAY); } -friday { kcallval.ival = 5; return(WDAY); } -saturday { kcallval.ival = 6; return(WDAY); } -sunday { kcallval.ival = 7; return(WDAY); } - -1st|first { kcallval.ival = 1; return(NUMBER); } -2nd|second { kcallval.ival = 2; return(NUMBER); } -3rd|third { kcallval.ival = 3; return(NUMBER); } -4th|fourth { kcallval.ival = 4; return(NUMBER); } -5th|fifth { kcallval.ival = 5; return(NUMBER); } -last { kcallval.ival = 999; return(NUMBER); } -any { kcallval.ival = 0; return(NUMBER); } - -before { kcallval.ival = -1; return(NUMBER); } -after { kcallval.ival = -2; return(NUMBER); } - -[0-9]+ { kcallval.ival = atoi(kcaltext); return(NUMBER); } - -\"[^"]*\" { kcallval.sval = strdup(kcaltext+1); - kcallval.sval[strlen(kcallval.sval)-1] = 0; - return(STRING); } - -every ; -day ; -days ; -on ; -to ; -in { return(HOLIDAY_IN); } -if { return(IF); } -plus { return(PLUS); } -minus { return(MINUS); } -small { return(SMALL); } -year { return(CYEAR); } -leapyear { return(LEAPYEAR); } -easter { return(EASTER); } -pascha { return(PASCHA); } -length { return(LENGTH); } -shift { return(SHIFT); } - -black { kcallval.ival = 1; return(COLOR); } -red { kcallval.ival = 2; return(COLOR); } -green { kcallval.ival = 3; return(COLOR); } -yellow { kcallval.ival = 4; return(COLOR); } -blue { kcallval.ival = 5; return(COLOR); } -magenta { kcallval.ival = 6; return(COLOR); } -cyan { kcallval.ival = 7; return(COLOR); } -white { kcallval.ival = 8; return(COLOR); } -weekend { kcallval.ival = 9; return(COLOR); } - -"==" { return(EQ); } -"!=" { return(NE); } -"<=" { return(LE); } -">=" { return(GE); } -"<" { return(LT); } -">" { return(GT); } -"&&" { return(AND);} -"||" { return(OR); } - -. { printf("holiday: bad char: %s \n", kcaltext); } - -%% diff --git a/kholidays/tests/CMakeLists.txt b/kholidays/tests/CMakeLists.txt deleted file mode 100644 index 06130bf58..000000000 --- a/kholidays/tests/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) - -include_directories( - ${CMAKE_SOURCE_DIR}/libkholidays -) - -########### next target ############### - -set(testlunar_SRCS testlunar.cpp ) - - -kde4_add_unit_test(testlunar TESTNAME kcal-testlunar ${testlunar_SRCS}) - -target_link_libraries(testlunar ${KDE4_KDECORE_LIBS} kholidays ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY}) - -########### next target ############### - -set(testseasons_SRCS testseasons.cpp ) - - -kde4_add_unit_test(testseasons TESTNAME kcal-testseasons ${testseasons_SRCS}) - -target_link_libraries(testseasons ${KDE4_KDECORE_LIBS} kholidays ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY}) - -########### next target ############### - -set(testzodiac_SRCS testzodiac.cpp ) - - -kde4_add_unit_test(testzodiac TESTNAME kcal-testzodiac ${testzodiac_SRCS}) - -target_link_libraries(testzodiac ${KDE4_KDECORE_LIBS} kholidays ${QT_QTTEST_LIBRARY}) - -########### next target ############### - -#set(testholiday_SRCS testholiday.cpp ) - - -#kde4_add_unit_test(testholiday TESTNAME kcal-testholiday ${testholiday_SRCS}) - -#target_link_libraries(testholiday ${KDE4_KDECORE_LIBS} kholidays ${QT_QTTEST_LIBRARY}) - -########### next target ############### - -#set(testus_SRCS testus.cpp ) - - -#kde4_add_unit_test(testus TESTNAME kcal-testus ${testus_SRCS}) - -#target_link_libraries(testus ${KDE4_KDECORE_LIBS} kholidays ${QT_QTTEST_LIBRARY}) diff --git a/kholidays/tests/data/testlunar.answers b/kholidays/tests/data/testlunar.answers deleted file mode 100644 index a67e98e91..000000000 --- a/kholidays/tests/data/testlunar.answers +++ /dev/null @@ -1,58 +0,0 @@ -Fri Nov 5 2004: Last Quarter Moon -Fri Nov 12 2004: New Moon -Fri Nov 19 2004: First Quarter Moon -Fri Nov 26 2004: Full Moon -Sat Dec 4 2004: Last Quarter Moon -Sat Dec 11 2004: New Moon -Sat Dec 18 2004: First Quarter Moon -Sun Dec 26 2004: Full Moon -Mon Jan 3 2005: Last Quarter Moon -Mon Jan 10 2005: New Moon -Mon Jan 17 2005: First Quarter Moon -Mon Jan 24 2005: Full Moon -Wed Feb 2 2005: Last Quarter Moon -Tue Feb 8 2005: New Moon -Tue Feb 15 2005: First Quarter Moon -Wed Feb 23 2005: Full Moon -Thu Mar 3 2005: Last Quarter Moon -Thu Mar 10 2005: New Moon -Thu Mar 17 2005: First Quarter Moon -Fri Mar 25 2005: Full Moon -Fri Apr 1 2005: Last Quarter Moon -Fri Apr 8 2005: New Moon -Sat Apr 16 2005: First Quarter Moon -Sun Apr 24 2005: Full Moon -Sun May 1 2005: Last Quarter Moon -Sun May 8 2005: New Moon -Mon May 16 2005: First Quarter Moon -Mon May 23 2005: Full Moon -Mon May 30 2005: Last Quarter Moon -Mon Jun 6 2005: New Moon -Tue Jun 14 2005: First Quarter Moon -Tue Jun 21 2005: Full Moon -Tue Jun 28 2005: Last Quarter Moon -Wed Jul 6 2005: New Moon -Thu Jul 14 2005: First Quarter Moon -Thu Jul 21 2005: Full Moon -Wed Jul 27 2005: Last Quarter Moon -Thu Aug 4 2005: New Moon -Fri Aug 12 2005: First Quarter Moon -Fri Aug 19 2005: Full Moon -Fri Aug 26 2005: Last Quarter Moon -Sat Sep 3 2005: New Moon -Sun Sep 11 2005: First Quarter Moon -Sat Sep 17 2005: Full Moon -Sun Sep 25 2005: Last Quarter Moon -Mon Oct 3 2005: New Moon -Mon Oct 10 2005: First Quarter Moon -Mon Oct 17 2005: Full Moon -Mon Oct 24 2005: Last Quarter Moon -Tue Nov 1 2005: New Moon -Tue Nov 8 2005: First Quarter Moon -Tue Nov 15 2005: Full Moon -Wed Nov 23 2005: Last Quarter Moon -Thu Dec 1 2005: New Moon -Thu Dec 8 2005: First Quarter Moon -Thu Dec 15 2005: Full Moon -Fri Dec 23 2005: Last Quarter Moon -Fri Dec 30 2005: New Moon diff --git a/kholidays/tests/data/testseasons.answers b/kholidays/tests/data/testseasons.answers deleted file mode 100644 index 1f1a1096a..000000000 --- a/kholidays/tests/data/testseasons.answers +++ /dev/null @@ -1,27 +0,0 @@ -Tue Dec 21 2004: December Solstice -Sun Mar 20 2005: March Equinox -Tue Jun 21 2005: June Solstice -Thu Sep 22 2005: September Equinox -Wed Dec 21 2005: December Solstice -Tue Mar 21 2006: March Equinox -Wed Jun 21 2006: June Solstice -Sat Sep 23 2006: September Equinox -Fri Dec 22 2006: December Solstice -Wed Mar 21 2007: March Equinox -Thu Jun 21 2007: June Solstice -Sat Sep 22 2007: September Equinox -Fri Dec 21 2007: December Solstice -Thu Mar 20 2008: March Equinox -Fri Jun 20 2008: June Solstice -Mon Sep 22 2008: September Equinox -Sun Dec 21 2008: December Solstice -Fri Mar 20 2009: March Equinox -Sun Jun 21 2009: June Solstice -Tue Sep 22 2009: September Equinox -Mon Dec 21 2009: December Solstice -Sat Mar 20 2010: March Equinox -Mon Jun 21 2010: June Solstice -Thu Sep 23 2010: September Equinox -Tue Dec 21 2010: December Solstice -Sun Mar 20 2011: March Equinox -Tue Jun 21 2011: June Solstice diff --git a/kholidays/tests/data/testzodiac.answers b/kholidays/tests/data/testzodiac.answers deleted file mode 100644 index a7835ac45..000000000 --- a/kholidays/tests/data/testzodiac.answers +++ /dev/null @@ -1,732 +0,0 @@ -Thu Jan 1 2004: Capricorn [goat] -Fri Jan 2 2004: Capricorn [goat] -Sat Jan 3 2004: Capricorn [goat] -Sun Jan 4 2004: Capricorn [goat] -Mon Jan 5 2004: Capricorn [goat] -Tue Jan 6 2004: Capricorn [goat] -Wed Jan 7 2004: Capricorn [goat] -Thu Jan 8 2004: Capricorn [goat] -Fri Jan 9 2004: Capricorn [goat] -Sat Jan 10 2004: Capricorn [goat] -Sun Jan 11 2004: Capricorn [goat] -Mon Jan 12 2004: Capricorn [goat] -Tue Jan 13 2004: Capricorn [goat] -Wed Jan 14 2004: Capricorn [goat] -Thu Jan 15 2004: Capricorn [goat] -Fri Jan 16 2004: Capricorn [goat] -Sat Jan 17 2004: Capricorn [goat] -Sun Jan 18 2004: Capricorn [goat] -Mon Jan 19 2004: Capricorn [goat] -Tue Jan 20 2004: Aquarius [water] -Wed Jan 21 2004: Aquarius [water] -Thu Jan 22 2004: Aquarius [water] -Fri Jan 23 2004: Aquarius [water] -Sat Jan 24 2004: Aquarius [water] -Sun Jan 25 2004: Aquarius [water] -Mon Jan 26 2004: Aquarius [water] -Tue Jan 27 2004: Aquarius [water] -Wed Jan 28 2004: Aquarius [water] -Thu Jan 29 2004: Aquarius [water] -Fri Jan 30 2004: Aquarius [water] -Sat Jan 31 2004: Aquarius [water] -Sun Feb 1 2004: Aquarius [water] -Mon Feb 2 2004: Aquarius [water] -Tue Feb 3 2004: Aquarius [water] -Wed Feb 4 2004: Aquarius [water] -Thu Feb 5 2004: Aquarius [water] -Fri Feb 6 2004: Aquarius [water] -Sat Feb 7 2004: Aquarius [water] -Sun Feb 8 2004: Aquarius [water] -Mon Feb 9 2004: Aquarius [water] -Tue Feb 10 2004: Aquarius [water] -Wed Feb 11 2004: Aquarius [water] -Thu Feb 12 2004: Aquarius [water] -Fri Feb 13 2004: Aquarius [water] -Sat Feb 14 2004: Aquarius [water] -Sun Feb 15 2004: Aquarius [water] -Mon Feb 16 2004: Aquarius [water] -Tue Feb 17 2004: Aquarius [water] -Wed Feb 18 2004: Aquarius [water] -Thu Feb 19 2004: Pisces [fish] -Fri Feb 20 2004: Pisces [fish] -Sat Feb 21 2004: Pisces [fish] -Sun Feb 22 2004: Pisces [fish] -Mon Feb 23 2004: Pisces [fish] -Tue Feb 24 2004: Pisces [fish] -Wed Feb 25 2004: Pisces [fish] -Thu Feb 26 2004: Pisces [fish] -Fri Feb 27 2004: Pisces [fish] -Sat Feb 28 2004: Pisces [fish] -Sun Feb 29 2004: Pisces [fish] -Mon Mar 1 2004: Pisces [fish] -Tue Mar 2 2004: Pisces [fish] -Wed Mar 3 2004: Pisces [fish] -Thu Mar 4 2004: Pisces [fish] -Fri Mar 5 2004: Pisces [fish] -Sat Mar 6 2004: Pisces [fish] -Sun Mar 7 2004: Pisces [fish] -Mon Mar 8 2004: Pisces [fish] -Tue Mar 9 2004: Pisces [fish] -Wed Mar 10 2004: Pisces [fish] -Thu Mar 11 2004: Pisces [fish] -Fri Mar 12 2004: Pisces [fish] -Sat Mar 13 2004: Pisces [fish] -Sun Mar 14 2004: Pisces [fish] -Mon Mar 15 2004: Pisces [fish] -Tue Mar 16 2004: Pisces [fish] -Wed Mar 17 2004: Pisces [fish] -Thu Mar 18 2004: Pisces [fish] -Fri Mar 19 2004: Pisces [fish] -Sat Mar 20 2004: Pisces [fish] -Sun Mar 21 2004: Aries [ram] -Mon Mar 22 2004: Aries [ram] -Tue Mar 23 2004: Aries [ram] -Wed Mar 24 2004: Aries [ram] -Thu Mar 25 2004: Aries [ram] -Fri Mar 26 2004: Aries [ram] -Sat Mar 27 2004: Aries [ram] -Sun Mar 28 2004: Aries [ram] -Mon Mar 29 2004: Aries [ram] -Tue Mar 30 2004: Aries [ram] -Wed Mar 31 2004: Aries [ram] -Thu Apr 1 2004: Aries [ram] -Fri Apr 2 2004: Aries [ram] -Sat Apr 3 2004: Aries [ram] -Sun Apr 4 2004: Aries [ram] -Mon Apr 5 2004: Aries [ram] -Tue Apr 6 2004: Aries [ram] -Wed Apr 7 2004: Aries [ram] -Thu Apr 8 2004: Aries [ram] -Fri Apr 9 2004: Aries [ram] -Sat Apr 10 2004: Aries [ram] -Sun Apr 11 2004: Aries [ram] -Mon Apr 12 2004: Aries [ram] -Tue Apr 13 2004: Aries [ram] -Wed Apr 14 2004: Aries [ram] -Thu Apr 15 2004: Aries [ram] -Fri Apr 16 2004: Aries [ram] -Sat Apr 17 2004: Aries [ram] -Sun Apr 18 2004: Aries [ram] -Mon Apr 19 2004: Aries [ram] -Tue Apr 20 2004: Taurus [bull] -Wed Apr 21 2004: Taurus [bull] -Thu Apr 22 2004: Taurus [bull] -Fri Apr 23 2004: Taurus [bull] -Sat Apr 24 2004: Taurus [bull] -Sun Apr 25 2004: Taurus [bull] -Mon Apr 26 2004: Taurus [bull] -Tue Apr 27 2004: Taurus [bull] -Wed Apr 28 2004: Taurus [bull] -Thu Apr 29 2004: Taurus [bull] -Fri Apr 30 2004: Taurus [bull] -Sat May 1 2004: Taurus [bull] -Sun May 2 2004: Taurus [bull] -Mon May 3 2004: Taurus [bull] -Tue May 4 2004: Taurus [bull] -Wed May 5 2004: Taurus [bull] -Thu May 6 2004: Taurus [bull] -Fri May 7 2004: Taurus [bull] -Sat May 8 2004: Taurus [bull] -Sun May 9 2004: Taurus [bull] -Mon May 10 2004: Taurus [bull] -Tue May 11 2004: Taurus [bull] -Wed May 12 2004: Taurus [bull] -Thu May 13 2004: Taurus [bull] -Fri May 14 2004: Taurus [bull] -Sat May 15 2004: Taurus [bull] -Sun May 16 2004: Taurus [bull] -Mon May 17 2004: Taurus [bull] -Tue May 18 2004: Taurus [bull] -Wed May 19 2004: Taurus [bull] -Thu May 20 2004: Taurus [bull] -Fri May 21 2004: Gemini [twins] -Sat May 22 2004: Gemini [twins] -Sun May 23 2004: Gemini [twins] -Mon May 24 2004: Gemini [twins] -Tue May 25 2004: Gemini [twins] -Wed May 26 2004: Gemini [twins] -Thu May 27 2004: Gemini [twins] -Fri May 28 2004: Gemini [twins] -Sat May 29 2004: Gemini [twins] -Sun May 30 2004: Gemini [twins] -Mon May 31 2004: Gemini [twins] -Tue Jun 1 2004: Gemini [twins] -Wed Jun 2 2004: Gemini [twins] -Thu Jun 3 2004: Gemini [twins] -Fri Jun 4 2004: Gemini [twins] -Sat Jun 5 2004: Gemini [twins] -Sun Jun 6 2004: Gemini [twins] -Mon Jun 7 2004: Gemini [twins] -Tue Jun 8 2004: Gemini [twins] -Wed Jun 9 2004: Gemini [twins] -Thu Jun 10 2004: Gemini [twins] -Fri Jun 11 2004: Gemini [twins] -Sat Jun 12 2004: Gemini [twins] -Sun Jun 13 2004: Gemini [twins] -Mon Jun 14 2004: Gemini [twins] -Tue Jun 15 2004: Gemini [twins] -Wed Jun 16 2004: Gemini [twins] -Thu Jun 17 2004: Gemini [twins] -Fri Jun 18 2004: Gemini [twins] -Sat Jun 19 2004: Gemini [twins] -Sun Jun 20 2004: Gemini [twins] -Mon Jun 21 2004: Cancer [crab] -Tue Jun 22 2004: Cancer [crab] -Wed Jun 23 2004: Cancer [crab] -Thu Jun 24 2004: Cancer [crab] -Fri Jun 25 2004: Cancer [crab] -Sat Jun 26 2004: Cancer [crab] -Sun Jun 27 2004: Cancer [crab] -Mon Jun 28 2004: Cancer [crab] -Tue Jun 29 2004: Cancer [crab] -Wed Jun 30 2004: Cancer [crab] -Thu Jul 1 2004: Cancer [crab] -Fri Jul 2 2004: Cancer [crab] -Sat Jul 3 2004: Cancer [crab] -Sun Jul 4 2004: Cancer [crab] -Mon Jul 5 2004: Cancer [crab] -Tue Jul 6 2004: Cancer [crab] -Wed Jul 7 2004: Cancer [crab] -Thu Jul 8 2004: Cancer [crab] -Fri Jul 9 2004: Cancer [crab] -Sat Jul 10 2004: Cancer [crab] -Sun Jul 11 2004: Cancer [crab] -Mon Jul 12 2004: Cancer [crab] -Tue Jul 13 2004: Cancer [crab] -Wed Jul 14 2004: Cancer [crab] -Thu Jul 15 2004: Cancer [crab] -Fri Jul 16 2004: Cancer [crab] -Sat Jul 17 2004: Cancer [crab] -Sun Jul 18 2004: Cancer [crab] -Mon Jul 19 2004: Cancer [crab] -Tue Jul 20 2004: Cancer [crab] -Wed Jul 21 2004: Cancer [crab] -Thu Jul 22 2004: Cancer [crab] -Fri Jul 23 2004: Leo [lion] -Sat Jul 24 2004: Leo [lion] -Sun Jul 25 2004: Leo [lion] -Mon Jul 26 2004: Leo [lion] -Tue Jul 27 2004: Leo [lion] -Wed Jul 28 2004: Leo [lion] -Thu Jul 29 2004: Leo [lion] -Fri Jul 30 2004: Leo [lion] -Sat Jul 31 2004: Leo [lion] -Sun Aug 1 2004: Leo [lion] -Mon Aug 2 2004: Leo [lion] -Tue Aug 3 2004: Leo [lion] -Wed Aug 4 2004: Leo [lion] -Thu Aug 5 2004: Leo [lion] -Fri Aug 6 2004: Leo [lion] -Sat Aug 7 2004: Leo [lion] -Sun Aug 8 2004: Leo [lion] -Mon Aug 9 2004: Leo [lion] -Tue Aug 10 2004: Leo [lion] -Wed Aug 11 2004: Leo [lion] -Thu Aug 12 2004: Leo [lion] -Fri Aug 13 2004: Leo [lion] -Sat Aug 14 2004: Leo [lion] -Sun Aug 15 2004: Leo [lion] -Mon Aug 16 2004: Leo [lion] -Tue Aug 17 2004: Leo [lion] -Wed Aug 18 2004: Leo [lion] -Thu Aug 19 2004: Leo [lion] -Fri Aug 20 2004: Leo [lion] -Sat Aug 21 2004: Leo [lion] -Sun Aug 22 2004: Leo [lion] -Mon Aug 23 2004: Virgo [virgin] -Tue Aug 24 2004: Virgo [virgin] -Wed Aug 25 2004: Virgo [virgin] -Thu Aug 26 2004: Virgo [virgin] -Fri Aug 27 2004: Virgo [virgin] -Sat Aug 28 2004: Virgo [virgin] -Sun Aug 29 2004: Virgo [virgin] -Mon Aug 30 2004: Virgo [virgin] -Tue Aug 31 2004: Virgo [virgin] -Wed Sep 1 2004: Virgo [virgin] -Thu Sep 2 2004: Virgo [virgin] -Fri Sep 3 2004: Virgo [virgin] -Sat Sep 4 2004: Virgo [virgin] -Sun Sep 5 2004: Virgo [virgin] -Mon Sep 6 2004: Virgo [virgin] -Tue Sep 7 2004: Virgo [virgin] -Wed Sep 8 2004: Virgo [virgin] -Thu Sep 9 2004: Virgo [virgin] -Fri Sep 10 2004: Virgo [virgin] -Sat Sep 11 2004: Virgo [virgin] -Sun Sep 12 2004: Virgo [virgin] -Mon Sep 13 2004: Virgo [virgin] -Tue Sep 14 2004: Virgo [virgin] -Wed Sep 15 2004: Virgo [virgin] -Thu Sep 16 2004: Virgo [virgin] -Fri Sep 17 2004: Virgo [virgin] -Sat Sep 18 2004: Virgo [virgin] -Sun Sep 19 2004: Virgo [virgin] -Mon Sep 20 2004: Virgo [virgin] -Tue Sep 21 2004: Virgo [virgin] -Wed Sep 22 2004: Virgo [virgin] -Thu Sep 23 2004: Libra [scale] -Fri Sep 24 2004: Libra [scale] -Sat Sep 25 2004: Libra [scale] -Sun Sep 26 2004: Libra [scale] -Mon Sep 27 2004: Libra [scale] -Tue Sep 28 2004: Libra [scale] -Wed Sep 29 2004: Libra [scale] -Thu Sep 30 2004: Libra [scale] -Fri Oct 1 2004: Libra [scale] -Sat Oct 2 2004: Libra [scale] -Sun Oct 3 2004: Libra [scale] -Mon Oct 4 2004: Libra [scale] -Tue Oct 5 2004: Libra [scale] -Wed Oct 6 2004: Libra [scale] -Thu Oct 7 2004: Libra [scale] -Fri Oct 8 2004: Libra [scale] -Sat Oct 9 2004: Libra [scale] -Sun Oct 10 2004: Libra [scale] -Mon Oct 11 2004: Libra [scale] -Tue Oct 12 2004: Libra [scale] -Wed Oct 13 2004: Libra [scale] -Thu Oct 14 2004: Libra [scale] -Fri Oct 15 2004: Libra [scale] -Sat Oct 16 2004: Libra [scale] -Sun Oct 17 2004: Libra [scale] -Mon Oct 18 2004: Libra [scale] -Tue Oct 19 2004: Libra [scale] -Wed Oct 20 2004: Libra [scale] -Thu Oct 21 2004: Libra [scale] -Fri Oct 22 2004: Libra [scale] -Sat Oct 23 2004: Scorpio [scorpion] -Sun Oct 24 2004: Scorpio [scorpion] -Mon Oct 25 2004: Scorpio [scorpion] -Tue Oct 26 2004: Scorpio [scorpion] -Wed Oct 27 2004: Scorpio [scorpion] -Thu Oct 28 2004: Scorpio [scorpion] -Fri Oct 29 2004: Scorpio [scorpion] -Sat Oct 30 2004: Scorpio [scorpion] -Sun Oct 31 2004: Scorpio [scorpion] -Mon Nov 1 2004: Scorpio [scorpion] -Tue Nov 2 2004: Scorpio [scorpion] -Wed Nov 3 2004: Scorpio [scorpion] -Thu Nov 4 2004: Scorpio [scorpion] -Fri Nov 5 2004: Scorpio [scorpion] -Sat Nov 6 2004: Scorpio [scorpion] -Sun Nov 7 2004: Scorpio [scorpion] -Mon Nov 8 2004: Scorpio [scorpion] -Tue Nov 9 2004: Scorpio [scorpion] -Wed Nov 10 2004: Scorpio [scorpion] -Thu Nov 11 2004: Scorpio [scorpion] -Fri Nov 12 2004: Scorpio [scorpion] -Sat Nov 13 2004: Scorpio [scorpion] -Sun Nov 14 2004: Scorpio [scorpion] -Mon Nov 15 2004: Scorpio [scorpion] -Tue Nov 16 2004: Scorpio [scorpion] -Wed Nov 17 2004: Scorpio [scorpion] -Thu Nov 18 2004: Scorpio [scorpion] -Fri Nov 19 2004: Scorpio [scorpion] -Sat Nov 20 2004: Scorpio [scorpion] -Sun Nov 21 2004: Scorpio [scorpion] -Mon Nov 22 2004: Sagittarius [archer] -Tue Nov 23 2004: Sagittarius [archer] -Wed Nov 24 2004: Sagittarius [archer] -Thu Nov 25 2004: Sagittarius [archer] -Fri Nov 26 2004: Sagittarius [archer] -Sat Nov 27 2004: Sagittarius [archer] -Sun Nov 28 2004: Sagittarius [archer] -Mon Nov 29 2004: Sagittarius [archer] -Tue Nov 30 2004: Sagittarius [archer] -Wed Dec 1 2004: Sagittarius [archer] -Thu Dec 2 2004: Sagittarius [archer] -Fri Dec 3 2004: Sagittarius [archer] -Sat Dec 4 2004: Sagittarius [archer] -Sun Dec 5 2004: Sagittarius [archer] -Mon Dec 6 2004: Sagittarius [archer] -Tue Dec 7 2004: Sagittarius [archer] -Wed Dec 8 2004: Sagittarius [archer] -Thu Dec 9 2004: Sagittarius [archer] -Fri Dec 10 2004: Sagittarius [archer] -Sat Dec 11 2004: Sagittarius [archer] -Sun Dec 12 2004: Sagittarius [archer] -Mon Dec 13 2004: Sagittarius [archer] -Tue Dec 14 2004: Sagittarius [archer] -Wed Dec 15 2004: Sagittarius [archer] -Thu Dec 16 2004: Sagittarius [archer] -Fri Dec 17 2004: Sagittarius [archer] -Sat Dec 18 2004: Sagittarius [archer] -Sun Dec 19 2004: Sagittarius [archer] -Mon Dec 20 2004: Sagittarius [archer] -Tue Dec 21 2004: Sagittarius [archer] -Wed Dec 22 2004: Capricorn [goat] -Thu Dec 23 2004: Capricorn [goat] -Fri Dec 24 2004: Capricorn [goat] -Sat Dec 25 2004: Capricorn [goat] -Sun Dec 26 2004: Capricorn [goat] -Mon Dec 27 2004: Capricorn [goat] -Tue Dec 28 2004: Capricorn [goat] -Wed Dec 29 2004: Capricorn [goat] -Thu Dec 30 2004: Capricorn [goat] -Fri Dec 31 2004: Capricorn [goat] -Thu Jan 1 2004: Sagittarius [archer] -Fri Jan 2 2004: Sagittarius [archer] -Sat Jan 3 2004: Sagittarius [archer] -Sun Jan 4 2004: Sagittarius [archer] -Mon Jan 5 2004: Sagittarius [archer] -Tue Jan 6 2004: Sagittarius [archer] -Wed Jan 7 2004: Sagittarius [archer] -Thu Jan 8 2004: Sagittarius [archer] -Fri Jan 9 2004: Sagittarius [archer] -Sat Jan 10 2004: Sagittarius [archer] -Sun Jan 11 2004: Sagittarius [archer] -Mon Jan 12 2004: Sagittarius [archer] -Tue Jan 13 2004: Sagittarius [archer] -Wed Jan 14 2004: Sagittarius [archer] -Thu Jan 15 2004: Capricorn [goat] -Fri Jan 16 2004: Capricorn [goat] -Sat Jan 17 2004: Capricorn [goat] -Sun Jan 18 2004: Capricorn [goat] -Mon Jan 19 2004: Capricorn [goat] -Tue Jan 20 2004: Capricorn [goat] -Wed Jan 21 2004: Capricorn [goat] -Thu Jan 22 2004: Capricorn [goat] -Fri Jan 23 2004: Capricorn [goat] -Sat Jan 24 2004: Capricorn [goat] -Sun Jan 25 2004: Capricorn [goat] -Mon Jan 26 2004: Capricorn [goat] -Tue Jan 27 2004: Capricorn [goat] -Wed Jan 28 2004: Capricorn [goat] -Thu Jan 29 2004: Capricorn [goat] -Fri Jan 30 2004: Capricorn [goat] -Sat Jan 31 2004: Capricorn [goat] -Sun Feb 1 2004: Capricorn [goat] -Mon Feb 2 2004: Capricorn [goat] -Tue Feb 3 2004: Capricorn [goat] -Wed Feb 4 2004: Capricorn [goat] -Thu Feb 5 2004: Capricorn [goat] -Fri Feb 6 2004: Capricorn [goat] -Sat Feb 7 2004: Capricorn [goat] -Sun Feb 8 2004: Capricorn [goat] -Mon Feb 9 2004: Capricorn [goat] -Tue Feb 10 2004: Capricorn [goat] -Wed Feb 11 2004: Capricorn [goat] -Thu Feb 12 2004: Capricorn [goat] -Fri Feb 13 2004: Aquarius [water] -Sat Feb 14 2004: Aquarius [water] -Sun Feb 15 2004: Aquarius [water] -Mon Feb 16 2004: Aquarius [water] -Tue Feb 17 2004: Aquarius [water] -Wed Feb 18 2004: Aquarius [water] -Thu Feb 19 2004: Aquarius [water] -Fri Feb 20 2004: Aquarius [water] -Sat Feb 21 2004: Aquarius [water] -Sun Feb 22 2004: Aquarius [water] -Mon Feb 23 2004: Aquarius [water] -Tue Feb 24 2004: Aquarius [water] -Wed Feb 25 2004: Aquarius [water] -Thu Feb 26 2004: Aquarius [water] -Fri Feb 27 2004: Aquarius [water] -Sat Feb 28 2004: Aquarius [water] -Sun Feb 29 2004: Aquarius [water] -Mon Mar 1 2004: Aquarius [water] -Tue Mar 2 2004: Aquarius [water] -Wed Mar 3 2004: Aquarius [water] -Thu Mar 4 2004: Aquarius [water] -Fri Mar 5 2004: Aquarius [water] -Sat Mar 6 2004: Aquarius [water] -Sun Mar 7 2004: Aquarius [water] -Mon Mar 8 2004: Aquarius [water] -Tue Mar 9 2004: Aquarius [water] -Wed Mar 10 2004: Aquarius [water] -Thu Mar 11 2004: Aquarius [water] -Fri Mar 12 2004: Aquarius [water] -Sat Mar 13 2004: Aquarius [water] -Sun Mar 14 2004: Aquarius [water] -Mon Mar 15 2004: Pisces [fish] -Tue Mar 16 2004: Pisces [fish] -Wed Mar 17 2004: Pisces [fish] -Thu Mar 18 2004: Pisces [fish] -Fri Mar 19 2004: Pisces [fish] -Sat Mar 20 2004: Pisces [fish] -Sun Mar 21 2004: Pisces [fish] -Mon Mar 22 2004: Pisces [fish] -Tue Mar 23 2004: Pisces [fish] -Wed Mar 24 2004: Pisces [fish] -Thu Mar 25 2004: Pisces [fish] -Fri Mar 26 2004: Pisces [fish] -Sat Mar 27 2004: Pisces [fish] -Sun Mar 28 2004: Pisces [fish] -Mon Mar 29 2004: Pisces [fish] -Tue Mar 30 2004: Pisces [fish] -Wed Mar 31 2004: Pisces [fish] -Thu Apr 1 2004: Pisces [fish] -Fri Apr 2 2004: Pisces [fish] -Sat Apr 3 2004: Pisces [fish] -Sun Apr 4 2004: Pisces [fish] -Mon Apr 5 2004: Pisces [fish] -Tue Apr 6 2004: Pisces [fish] -Wed Apr 7 2004: Pisces [fish] -Thu Apr 8 2004: Pisces [fish] -Fri Apr 9 2004: Pisces [fish] -Sat Apr 10 2004: Pisces [fish] -Sun Apr 11 2004: Pisces [fish] -Mon Apr 12 2004: Pisces [fish] -Tue Apr 13 2004: Pisces [fish] -Wed Apr 14 2004: Aries [ram] -Thu Apr 15 2004: Aries [ram] -Fri Apr 16 2004: Aries [ram] -Sat Apr 17 2004: Aries [ram] -Sun Apr 18 2004: Aries [ram] -Mon Apr 19 2004: Aries [ram] -Tue Apr 20 2004: Aries [ram] -Wed Apr 21 2004: Aries [ram] -Thu Apr 22 2004: Aries [ram] -Fri Apr 23 2004: Aries [ram] -Sat Apr 24 2004: Aries [ram] -Sun Apr 25 2004: Aries [ram] -Mon Apr 26 2004: Aries [ram] -Tue Apr 27 2004: Aries [ram] -Wed Apr 28 2004: Aries [ram] -Thu Apr 29 2004: Aries [ram] -Fri Apr 30 2004: Aries [ram] -Sat May 1 2004: Aries [ram] -Sun May 2 2004: Aries [ram] -Mon May 3 2004: Aries [ram] -Tue May 4 2004: Aries [ram] -Wed May 5 2004: Aries [ram] -Thu May 6 2004: Aries [ram] -Fri May 7 2004: Aries [ram] -Sat May 8 2004: Aries [ram] -Sun May 9 2004: Aries [ram] -Mon May 10 2004: Aries [ram] -Tue May 11 2004: Aries [ram] -Wed May 12 2004: Aries [ram] -Thu May 13 2004: Aries [ram] -Fri May 14 2004: Aries [ram] -Sat May 15 2004: Taurus [bull] -Sun May 16 2004: Taurus [bull] -Mon May 17 2004: Taurus [bull] -Tue May 18 2004: Taurus [bull] -Wed May 19 2004: Taurus [bull] -Thu May 20 2004: Taurus [bull] -Fri May 21 2004: Taurus [bull] -Sat May 22 2004: Taurus [bull] -Sun May 23 2004: Taurus [bull] -Mon May 24 2004: Taurus [bull] -Tue May 25 2004: Taurus [bull] -Wed May 26 2004: Taurus [bull] -Thu May 27 2004: Taurus [bull] -Fri May 28 2004: Taurus [bull] -Sat May 29 2004: Taurus [bull] -Sun May 30 2004: Taurus [bull] -Mon May 31 2004: Taurus [bull] -Tue Jun 1 2004: Taurus [bull] -Wed Jun 2 2004: Taurus [bull] -Thu Jun 3 2004: Taurus [bull] -Fri Jun 4 2004: Taurus [bull] -Sat Jun 5 2004: Taurus [bull] -Sun Jun 6 2004: Taurus [bull] -Mon Jun 7 2004: Taurus [bull] -Tue Jun 8 2004: Taurus [bull] -Wed Jun 9 2004: Taurus [bull] -Thu Jun 10 2004: Taurus [bull] -Fri Jun 11 2004: Taurus [bull] -Sat Jun 12 2004: Taurus [bull] -Sun Jun 13 2004: Taurus [bull] -Mon Jun 14 2004: Taurus [bull] -Tue Jun 15 2004: Gemini [twins] -Wed Jun 16 2004: Gemini [twins] -Thu Jun 17 2004: Gemini [twins] -Fri Jun 18 2004: Gemini [twins] -Sat Jun 19 2004: Gemini [twins] -Sun Jun 20 2004: Gemini [twins] -Mon Jun 21 2004: Gemini [twins] -Tue Jun 22 2004: Gemini [twins] -Wed Jun 23 2004: Gemini [twins] -Thu Jun 24 2004: Gemini [twins] -Fri Jun 25 2004: Gemini [twins] -Sat Jun 26 2004: Gemini [twins] -Sun Jun 27 2004: Gemini [twins] -Mon Jun 28 2004: Gemini [twins] -Tue Jun 29 2004: Gemini [twins] -Wed Jun 30 2004: Gemini [twins] -Thu Jul 1 2004: Gemini [twins] -Fri Jul 2 2004: Gemini [twins] -Sat Jul 3 2004: Gemini [twins] -Sun Jul 4 2004: Gemini [twins] -Mon Jul 5 2004: Gemini [twins] -Tue Jul 6 2004: Gemini [twins] -Wed Jul 7 2004: Gemini [twins] -Thu Jul 8 2004: Gemini [twins] -Fri Jul 9 2004: Gemini [twins] -Sat Jul 10 2004: Gemini [twins] -Sun Jul 11 2004: Gemini [twins] -Mon Jul 12 2004: Gemini [twins] -Tue Jul 13 2004: Gemini [twins] -Wed Jul 14 2004: Gemini [twins] -Thu Jul 15 2004: Gemini [twins] -Fri Jul 16 2004: Gemini [twins] -Sat Jul 17 2004: Cancer [crab] -Sun Jul 18 2004: Cancer [crab] -Mon Jul 19 2004: Cancer [crab] -Tue Jul 20 2004: Cancer [crab] -Wed Jul 21 2004: Cancer [crab] -Thu Jul 22 2004: Cancer [crab] -Fri Jul 23 2004: Cancer [crab] -Sat Jul 24 2004: Cancer [crab] -Sun Jul 25 2004: Cancer [crab] -Mon Jul 26 2004: Cancer [crab] -Tue Jul 27 2004: Cancer [crab] -Wed Jul 28 2004: Cancer [crab] -Thu Jul 29 2004: Cancer [crab] -Fri Jul 30 2004: Cancer [crab] -Sat Jul 31 2004: Cancer [crab] -Sun Aug 1 2004: Cancer [crab] -Mon Aug 2 2004: Cancer [crab] -Tue Aug 3 2004: Cancer [crab] -Wed Aug 4 2004: Cancer [crab] -Thu Aug 5 2004: Cancer [crab] -Fri Aug 6 2004: Cancer [crab] -Sat Aug 7 2004: Cancer [crab] -Sun Aug 8 2004: Cancer [crab] -Mon Aug 9 2004: Cancer [crab] -Tue Aug 10 2004: Cancer [crab] -Wed Aug 11 2004: Cancer [crab] -Thu Aug 12 2004: Cancer [crab] -Fri Aug 13 2004: Cancer [crab] -Sat Aug 14 2004: Cancer [crab] -Sun Aug 15 2004: Cancer [crab] -Mon Aug 16 2004: Cancer [crab] -Tue Aug 17 2004: Leo [lion] -Wed Aug 18 2004: Leo [lion] -Thu Aug 19 2004: Leo [lion] -Fri Aug 20 2004: Leo [lion] -Sat Aug 21 2004: Leo [lion] -Sun Aug 22 2004: Leo [lion] -Mon Aug 23 2004: Leo [lion] -Tue Aug 24 2004: Leo [lion] -Wed Aug 25 2004: Leo [lion] -Thu Aug 26 2004: Leo [lion] -Fri Aug 27 2004: Leo [lion] -Sat Aug 28 2004: Leo [lion] -Sun Aug 29 2004: Leo [lion] -Mon Aug 30 2004: Leo [lion] -Tue Aug 31 2004: Leo [lion] -Wed Sep 1 2004: Leo [lion] -Thu Sep 2 2004: Leo [lion] -Fri Sep 3 2004: Leo [lion] -Sat Sep 4 2004: Leo [lion] -Sun Sep 5 2004: Leo [lion] -Mon Sep 6 2004: Leo [lion] -Tue Sep 7 2004: Leo [lion] -Wed Sep 8 2004: Leo [lion] -Thu Sep 9 2004: Leo [lion] -Fri Sep 10 2004: Leo [lion] -Sat Sep 11 2004: Leo [lion] -Sun Sep 12 2004: Leo [lion] -Mon Sep 13 2004: Leo [lion] -Tue Sep 14 2004: Leo [lion] -Wed Sep 15 2004: Leo [lion] -Thu Sep 16 2004: Leo [lion] -Fri Sep 17 2004: Virgo [virgin] -Sat Sep 18 2004: Virgo [virgin] -Sun Sep 19 2004: Virgo [virgin] -Mon Sep 20 2004: Virgo [virgin] -Tue Sep 21 2004: Virgo [virgin] -Wed Sep 22 2004: Virgo [virgin] -Thu Sep 23 2004: Virgo [virgin] -Fri Sep 24 2004: Virgo [virgin] -Sat Sep 25 2004: Virgo [virgin] -Sun Sep 26 2004: Virgo [virgin] -Mon Sep 27 2004: Virgo [virgin] -Tue Sep 28 2004: Virgo [virgin] -Wed Sep 29 2004: Virgo [virgin] -Thu Sep 30 2004: Virgo [virgin] -Fri Oct 1 2004: Virgo [virgin] -Sat Oct 2 2004: Virgo [virgin] -Sun Oct 3 2004: Virgo [virgin] -Mon Oct 4 2004: Virgo [virgin] -Tue Oct 5 2004: Virgo [virgin] -Wed Oct 6 2004: Virgo [virgin] -Thu Oct 7 2004: Virgo [virgin] -Fri Oct 8 2004: Virgo [virgin] -Sat Oct 9 2004: Virgo [virgin] -Sun Oct 10 2004: Virgo [virgin] -Mon Oct 11 2004: Virgo [virgin] -Tue Oct 12 2004: Virgo [virgin] -Wed Oct 13 2004: Virgo [virgin] -Thu Oct 14 2004: Virgo [virgin] -Fri Oct 15 2004: Virgo [virgin] -Sat Oct 16 2004: Virgo [virgin] -Sun Oct 17 2004: Virgo [virgin] -Mon Oct 18 2004: Libra [scale] -Tue Oct 19 2004: Libra [scale] -Wed Oct 20 2004: Libra [scale] -Thu Oct 21 2004: Libra [scale] -Fri Oct 22 2004: Libra [scale] -Sat Oct 23 2004: Libra [scale] -Sun Oct 24 2004: Libra [scale] -Mon Oct 25 2004: Libra [scale] -Tue Oct 26 2004: Libra [scale] -Wed Oct 27 2004: Libra [scale] -Thu Oct 28 2004: Libra [scale] -Fri Oct 29 2004: Libra [scale] -Sat Oct 30 2004: Libra [scale] -Sun Oct 31 2004: Libra [scale] -Mon Nov 1 2004: Libra [scale] -Tue Nov 2 2004: Libra [scale] -Wed Nov 3 2004: Libra [scale] -Thu Nov 4 2004: Libra [scale] -Fri Nov 5 2004: Libra [scale] -Sat Nov 6 2004: Libra [scale] -Sun Nov 7 2004: Libra [scale] -Mon Nov 8 2004: Libra [scale] -Tue Nov 9 2004: Libra [scale] -Wed Nov 10 2004: Libra [scale] -Thu Nov 11 2004: Libra [scale] -Fri Nov 12 2004: Libra [scale] -Sat Nov 13 2004: Libra [scale] -Sun Nov 14 2004: Libra [scale] -Mon Nov 15 2004: Libra [scale] -Tue Nov 16 2004: Libra [scale] -Wed Nov 17 2004: Scorpio [scorpion] -Thu Nov 18 2004: Scorpio [scorpion] -Fri Nov 19 2004: Scorpio [scorpion] -Sat Nov 20 2004: Scorpio [scorpion] -Sun Nov 21 2004: Scorpio [scorpion] -Mon Nov 22 2004: Scorpio [scorpion] -Tue Nov 23 2004: Scorpio [scorpion] -Wed Nov 24 2004: Scorpio [scorpion] -Thu Nov 25 2004: Scorpio [scorpion] -Fri Nov 26 2004: Scorpio [scorpion] -Sat Nov 27 2004: Scorpio [scorpion] -Sun Nov 28 2004: Scorpio [scorpion] -Mon Nov 29 2004: Scorpio [scorpion] -Tue Nov 30 2004: Scorpio [scorpion] -Wed Dec 1 2004: Scorpio [scorpion] -Thu Dec 2 2004: Scorpio [scorpion] -Fri Dec 3 2004: Scorpio [scorpion] -Sat Dec 4 2004: Scorpio [scorpion] -Sun Dec 5 2004: Scorpio [scorpion] -Mon Dec 6 2004: Scorpio [scorpion] -Tue Dec 7 2004: Scorpio [scorpion] -Wed Dec 8 2004: Scorpio [scorpion] -Thu Dec 9 2004: Scorpio [scorpion] -Fri Dec 10 2004: Scorpio [scorpion] -Sat Dec 11 2004: Scorpio [scorpion] -Sun Dec 12 2004: Scorpio [scorpion] -Mon Dec 13 2004: Scorpio [scorpion] -Tue Dec 14 2004: Scorpio [scorpion] -Wed Dec 15 2004: Scorpio [scorpion] -Thu Dec 16 2004: Sagittarius [archer] -Fri Dec 17 2004: Sagittarius [archer] -Sat Dec 18 2004: Sagittarius [archer] -Sun Dec 19 2004: Sagittarius [archer] -Mon Dec 20 2004: Sagittarius [archer] -Tue Dec 21 2004: Sagittarius [archer] -Wed Dec 22 2004: Sagittarius [archer] -Thu Dec 23 2004: Sagittarius [archer] -Fri Dec 24 2004: Sagittarius [archer] -Sat Dec 25 2004: Sagittarius [archer] -Sun Dec 26 2004: Sagittarius [archer] -Mon Dec 27 2004: Sagittarius [archer] -Tue Dec 28 2004: Sagittarius [archer] -Wed Dec 29 2004: Sagittarius [archer] -Thu Dec 30 2004: Sagittarius [archer] -Fri Dec 31 2004: Sagittarius [archer] diff --git a/kholidays/tests/testlunar.cpp b/kholidays/tests/testlunar.cpp deleted file mode 100644 index 79e69547a..000000000 --- a/kholidays/tests/testlunar.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "testlunar.h" -#include -#include -#include -#include "testlunar.moc" - -QTEST_KDEMAIN( LunarTest, NoGUI ) - -#include "libkholidays/lunarphase.h" -using namespace LibKHolidays; - -void LunarTest::test2005() -{ - - QList fQ2005, fM2005, lQ2005, nM2005; - //2005 first quarter moons - fQ2005.append( QDate( 2005, 1, 17 ) ); - fQ2005.append( QDate( 2005, 2, 16 ) ); - fQ2005.append( QDate( 2005, 3, 17 ) ); - fQ2005.append( QDate( 2005, 4, 16 ) ); - fQ2005.append( QDate( 2005, 5, 16 ) ); - fQ2005.append( QDate( 2005, 6, 15 ) ); - fQ2005.append( QDate( 2005, 7, 14 ) ); - fQ2005.append( QDate( 2005, 8, 13 ) ); - fQ2005.append( QDate( 2005, 9, 11 ) ); - fQ2005.append( QDate( 2005, 10, 10 ) ); - fQ2005.append( QDate( 2005, 11, 9 ) ); - fQ2005.append( QDate( 2005, 12, 8 ) ); - - //2005 full moons - fM2005.append( QDate( 2005, 1, 25 ) ); - fM2005.append( QDate( 2005, 2, 24 ) ); - fM2005.append( QDate( 2005, 3, 25 ) ); - fM2005.append( QDate( 2005, 4, 24 ) ); - fM2005.append( QDate( 2005, 5, 23 ) ); - fM2005.append( QDate( 2005, 6, 22 ) ); - fM2005.append( QDate( 2005, 7, 21 ) ); - fM2005.append( QDate( 2005, 8, 19 ) ); - fM2005.append( QDate( 2005, 9, 18 ) ); - fM2005.append( QDate( 2005, 10, 17 ) ); - fM2005.append( QDate( 2005, 11, 16 ) ); - fM2005.append( QDate( 2005, 12, 15 ) ); - - //2005 last quarter moons - lQ2005.append( QDate( 2005, 1, 3 ) ); - lQ2005.append( QDate( 2005, 2, 2 ) ); - lQ2005.append( QDate( 2005, 3, 3 ) ); - lQ2005.append( QDate( 2005, 4, 2 ) ); - lQ2005.append( QDate( 2005, 5, 1 ) ); - lQ2005.append( QDate( 2005, 5, 30 ) ); - lQ2005.append( QDate( 2005, 6, 28 ) ); - lQ2005.append( QDate( 2005, 7, 28 ) ); - lQ2005.append( QDate( 2005, 8, 26 ) ); - lQ2005.append( QDate( 2005, 9, 25 ) ); - lQ2005.append( QDate( 2005, 10, 25 ) ); - lQ2005.append( QDate( 2005, 11, 23 ) ); - lQ2005.append( QDate( 2005, 12, 23 ) ); - - //2005 new moons - nM2005.append( QDate( 2005, 1, 10 ) ); - nM2005.append( QDate( 2005, 2, 8 ) ); - nM2005.append( QDate( 2005, 3, 10 ) ); - nM2005.append( QDate( 2005, 4, 8 ) ); - nM2005.append( QDate( 2005, 5, 8 ) ); - nM2005.append( QDate( 2005, 6, 6 ) ); - nM2005.append( QDate( 2005, 7, 6 ) ); - nM2005.append( QDate( 2005, 8, 5 ) ); - nM2005.append( QDate( 2005, 9, 3 ) ); - nM2005.append( QDate( 2005, 10, 3 ) ); - nM2005.append( QDate( 2005, 11, 2 ) ); - nM2005.append( QDate( 2005, 12, 1 ) ); - nM2005.append( QDate( 2005, 12, 31 ) ); - - LunarPhase lp; - QDate qd( 2004, 12, 31 ); - QList firstQuarter, fullMoon, lastQuarter, newMoon; - for ( int i=1; i<=365; ++i ) { - qd = qd.addDays( 1 ); - LunarPhase::Phase phase = lp.phase( qd ); - if ( phase == LunarPhase::FirstQuarter ) { - firstQuarter.append( qd ); - kDebug() <<"first quarter" << qd; - } - else if ( phase == LunarPhase::FullMoon ) { - fullMoon.append( qd ); - kDebug() <<"full moon" << qd; - } - else if ( phase == LunarPhase::LastQuarter ) { - lastQuarter.append( qd ); - kDebug() <<"last quarter" << qd; - } - else if ( phase == LunarPhase::NewMoon ) { - newMoon.append( qd ); - kDebug() <<"new moon" << qd; - } - } - QVERIFY( fQ2005 == firstQuarter ); - QVERIFY( fM2005 == fullMoon ); - QVERIFY( lQ2005 == lastQuarter ); - QVERIFY( nM2005 == newMoon ); -} - -void LunarTest::test2007() -{ - QList fQ2007, fM2007, lQ2007, nM2007; - //2007 first quarter moons - fQ2007.append( QDate( 2007, 1, 25 ) ); - fQ2007.append( QDate( 2007, 2, 24 ) ); - fQ2007.append( QDate( 2007, 3, 25 ) ); - fQ2007.append( QDate( 2007, 4, 24 ) ); - fQ2007.append( QDate( 2007, 5, 23 ) ); - fQ2007.append( QDate( 2007, 6, 22 ) ); - fQ2007.append( QDate( 2007, 7, 22 ) ); - fQ2007.append( QDate( 2007, 8, 20 ) ); - fQ2007.append( QDate( 2007, 9, 19 ) ); - fQ2007.append( QDate( 2007, 10, 19 ) ); - fQ2007.append( QDate( 2007, 11, 17 ) ); - fQ2007.append( QDate( 2007, 12, 17 ) ); - - //2007 full moons - fM2007.append( QDate( 2007, 1, 3 ) ); - fM2007.append( QDate( 2007, 2, 2 ) ); - fM2007.append( QDate( 2007, 3, 3 ) ); - fM2007.append( QDate( 2007, 4, 2 ) ); - fM2007.append( QDate( 2007, 5, 2 ) ); - fM2007.append( QDate( 2007, 6, 1 ) ); - fM2007.append( QDate( 2007, 6, 30 ) ); - fM2007.append( QDate( 2007, 7, 30 ) ); - fM2007.append( QDate( 2007, 8, 28 ) ); - fM2007.append( QDate( 2007, 9, 26 ) ); - fM2007.append( QDate( 2007, 10, 26 ) ); - fM2007.append( QDate( 2007, 11, 24 ) ); - fM2007.append( QDate( 2007, 12, 24 ) ); - - //2007 last quarter moons - lQ2007.append( QDate( 2007, 1, 11 ) ); - lQ2007.append( QDate( 2007, 2, 10 ) ); - lQ2007.append( QDate( 2007, 3, 12 ) ); - lQ2007.append( QDate( 2007, 4, 10 ) ); - lQ2007.append( QDate( 2007, 5, 10 ) ); - lQ2007.append( QDate( 2007, 6, 8 ) ); - lQ2007.append( QDate( 2007, 7, 7 ) ); - lQ2007.append( QDate( 2007, 8, 5 ) ); - lQ2007.append( QDate( 2007, 9, 4 ) ); - lQ2007.append( QDate( 2007, 10, 3 ) ); - lQ2007.append( QDate( 2007, 11, 1 ) ); - lQ2007.append( QDate( 2007, 12, 1 ) ); - lQ2007.append( QDate( 2007, 12, 31 ) ); - - //2007 new moons - nM2007.append( QDate( 2007, 1, 19 ) ); - nM2007.append( QDate( 2007, 2, 17 ) ); - nM2007.append( QDate( 2007, 3, 19 ) ); - nM2007.append( QDate( 2007, 4, 17 ) ); - nM2007.append( QDate( 2007, 5, 16 ) ); - nM2007.append( QDate( 2007, 6, 15 ) ); - nM2007.append( QDate( 2007, 7, 14 ) ); - nM2007.append( QDate( 2007, 8, 12 ) ); - nM2007.append( QDate( 2007, 9, 11 ) ); - nM2007.append( QDate( 2007, 10, 11 ) ); - nM2007.append( QDate( 2007, 11, 9 ) ); - nM2007.append( QDate( 2007, 12, 9 ) ); - - LunarPhase lp; - QDate qd( 2006, 12, 31 ); - QList firstQuarter, fullMoon, lastQuarter, newMoon; - for ( int i=1; i<=365; ++i ) { - qd = qd.addDays( 1 ); - LunarPhase::Phase phase = lp.phase( qd ); - if ( phase == LunarPhase::FirstQuarter ) { - firstQuarter.append( qd ); - kDebug() <<"first quarter" << qd; - } - else if ( phase == LunarPhase::FullMoon ) { - fullMoon.append( qd ); - kDebug() <<"full moon" << qd; - } - else if ( phase == LunarPhase::LastQuarter ) { - lastQuarter.append( qd ); - kDebug() <<"last quarter" << qd; - } - else if ( phase == LunarPhase::NewMoon ) { - newMoon.append( qd ); - kDebug() <<"new moon" << qd; - } - } - QVERIFY( fQ2007 == firstQuarter ); - QVERIFY( fM2007 == fullMoon ); - QVERIFY( lQ2007 == lastQuarter ); - QVERIFY( nM2007 == newMoon ); -} diff --git a/kholidays/tests/testlunar.h b/kholidays/tests/testlunar.h deleted file mode 100644 index 58f910594..000000000 --- a/kholidays/tests/testlunar.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef TESTLUNAR_H -#define TESTLUNAR_H - -#include - -class LunarTest : public QObject -{ - Q_OBJECT - private Q_SLOTS: - void test2005(); - void test2007(); -}; - -#endif diff --git a/kholidays/tests/testseasons.cpp b/kholidays/tests/testseasons.cpp deleted file mode 100644 index a7220c021..000000000 --- a/kholidays/tests/testseasons.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2004,2006-2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "testseasons.h" -#include -#include -#include "testseasons.moc" - -QTEST_KDEMAIN( SeasonsTest, NoGUI ) - -#include "libkholidays/astroseasons.h" -using namespace LibKHolidays; - -void SeasonsTest::test2005() -{ - AstroSeasons as; - QVERIFY( as.season( QDate( 2005, 3, 22 ) ) == AstroSeasons::MarchEquinox ); - QVERIFY( as.season( QDate( 2005, 6, 22 ) ) == AstroSeasons::JuneSolstice ); - QVERIFY( as.season( QDate( 2005, 9, 22 ) ) == AstroSeasons::SeptemberEquinox ); - QVERIFY( as.season( QDate( 2005, 12, 22 ) ) == AstroSeasons::DecemberSolstice ); - QVERIFY( as.season( QDate( 2005, 1, 22 ) ) == AstroSeasons::None ); - QVERIFY( as.season( QDate( 2005, 12, 31 ) ) == AstroSeasons::None ); -} - -void SeasonsTest::test2007() -{ - AstroSeasons as; - QVERIFY( as.season( QDate( 2007, 3, 22 ) ) == AstroSeasons::MarchEquinox ); - QVERIFY( as.season( QDate( 2007, 6, 22 ) ) == AstroSeasons::JuneSolstice ); - QVERIFY( as.season( QDate( 2007, 9, 22 ) ) == AstroSeasons::SeptemberEquinox ); - QVERIFY( as.season( QDate( 2007, 12, 22 ) ) == AstroSeasons::DecemberSolstice ); - QVERIFY( as.season( QDate( 2007, 1, 2 ) ) == AstroSeasons::None ); - QVERIFY( as.season( QDate( 2007, 11, 30 ) ) == AstroSeasons::None ); -} diff --git a/kholidays/tests/testseasons.h b/kholidays/tests/testseasons.h deleted file mode 100644 index e6433b418..000000000 --- a/kholidays/tests/testseasons.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef TESTSEASONS_H -#define TESTSEASONS_H - -#include - -class SeasonsTest : public QObject -{ - Q_OBJECT - private Q_SLOTS: - void test2005(); - void test2007(); -}; - -#endif diff --git a/kholidays/tests/testzodiac.cpp b/kholidays/tests/testzodiac.cpp deleted file mode 100644 index 0476f613b..000000000 --- a/kholidays/tests/testzodiac.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - This file is part of kholidays library. - - Copyright (c) 2005,2006 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "zodiac.h" - -#include -#include -#include -#include - -#include -#include - -#include -#include - -using namespace LibKHolidays; -using namespace std; - -int main( int argc, char **argv ) -{ - - KCmdLineOptions options; - options.add( "verbose", ki18n( "Verbose output" ) ); - KAboutData aboutData( "testzodiac", 0, ki18n( "Test Zodiac Calendar" ), "0.1" ); - QCoreApplication app( argc, argv ); - - Zodiac::ZodiacSigns sign; - QString pStr; - - int year = 2004; - int days = ( QDate::isLeapYear( year ) ? 366 : 355 ); - - Zodiac zd( Zodiac::Tropical ); - QDate qd( year, 1, 1 ); - for ( int i=1; i<=days; ++i ) { - sign = zd.sign( qd ); - pStr = zd.signName( sign ); - if ( !pStr.isNull() ) { - cout << qd.toString( Qt::TextDate ).toLocal8Bit().constData() << ": " - << pStr.toLocal8Bit().constData() - << " [" << qPrintable( zd.signSymbol( sign ) ) << "]" - << endl; - } - qd = qd.addDays( 1 ); - } - - Zodiac zd2( Zodiac::Sidereal ); - QDate qd2( year, 1, 1 ); - for ( int i=1; i<=days; ++i ) { - sign = zd2.sign( qd2 ); - pStr = zd2.signName( sign ); - if ( !pStr.isNull() ) { - cout << qd2.toString( Qt::TextDate ).toLocal8Bit().constData() << ": " - << pStr.toLocal8Bit().constData() - << " [" << qPrintable( zd2.signSymbol( sign ) ) << "]" - << endl; - } - qd2 = qd2.addDays( 1 ); - } -} diff --git a/kholidays/zodiac.cpp b/kholidays/zodiac.cpp deleted file mode 100644 index 9b9881ac4..000000000 --- a/kholidays/zodiac.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2005-2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "zodiac.h" -#include -#include - -using namespace LibKHolidays; - -Zodiac::Zodiac( ZodiacType type ) -{ - mType = type; -} - -Zodiac::~Zodiac() -{ -} - -QString Zodiac::signStr( const QDate &date ) const -{ - return signName( sign( date ) ); -} - -QString Zodiac::signName( Zodiac::ZodiacSigns sign ) -{ - switch ( sign ) { - case Aries: - return i18n( "Aries" ); - case Taurus: - return i18n( "Taurus" ); - case Gemini: - return i18n( "Gemini" ); - case Cancer: - return i18n( "Cancer" ); - case Leo: - return i18n( "Leo" ); - case Virgo: - return i18n( "Virgo" ); - case Libra: - return i18n( "Libra" ); - case Scorpio: - return i18n( "Scorpio" ); - case Sagittarius: - return i18n( "Sagittarius" ); - case Capricorn: - return i18n( "Capricorn" ); - case Aquarius: - return i18n( "Aquarius" ); - case Pisces: - return i18n( "Pisces" ); - default: - case None: - return QString(); - } -} - -Zodiac::ZodiacSigns Zodiac::sign( const QDate &date ) const -{ - QDate startdate, enddate; - - switch( mType ) { - case Tropical: - startdate = QDate( date.year(), 1, 1 ); - enddate = QDate( date.year(), 1, 19 ); - if ( date >= startdate && date <= enddate ) { - return Capricorn; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 29 ); - if ( date >= startdate && date <= enddate ) { - return Aquarius; - } - - startdate = enddate.addDays( 1 ); - enddate = QDate( date.year(), 3, 20 ); - if ( date >= startdate && date <= enddate ) { - return Pisces; - } - - startdate = enddate.addDays( 1 ); // March 21 - enddate = startdate.addDays( 29 ); - if ( date >= startdate && date <= enddate ) { - return Aries; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Taurus; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Gemini; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 31 ); - if ( date >= startdate && date <= enddate ) { - return Cancer; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Leo; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Virgo; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 29 ); - if ( date >= startdate && date <= enddate ) { - return Libra; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 29 ); - if ( date >= startdate && date <= enddate ) { - return Scorpio; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 29 ); - if ( date >= startdate && date <= enddate ) { - return Sagittarius; - } - - return Capricorn; - break; - - case Sidereal: - startdate = QDate( date.year(), 1, 1 ); - enddate = QDate( date.year(), 1, 14 ); - if ( date >= startdate && date <= enddate ) { - return Sagittarius; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 28 ); - if ( date >= startdate && date <= enddate ) { - return Capricorn; - } - - startdate = enddate.addDays( 1 ); - enddate = QDate( date.year(), 3, 14 ); - if ( date >= startdate && date <= enddate ) { - return Aquarius; - } - - startdate = enddate.addDays( 1 ); - enddate = QDate( date.year(), 4, 13 ); - if ( date >= startdate && date <= enddate ) { - return Pisces; - } - - startdate = QDate( date.year(), 4, 14 ); // April 14 - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Aries; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Taurus; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 31 ); - if ( date >= startdate && date <= enddate ) { - return Gemini; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Cancer; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Leo; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 30 ); - if ( date >= startdate && date <= enddate ) { - return Virgo; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 29 ); - if ( date >= startdate && date <= enddate ) { - return Libra; - } - - startdate = enddate.addDays( 1 ); - enddate = startdate.addDays( 28 ); - if ( date >= startdate && date <= enddate ) { - return Scorpio; - } - - return Sagittarius; - break; - } - return None; -} - -QString Zodiac::signSymbol( Zodiac::ZodiacSigns sign ) -{ - switch( sign ) { - case Aries: - return i18n( "ram" ); - case Taurus: - return i18n( "bull" ); - case Gemini: - return i18n( "twins" ); - case Cancer: - return i18n( "crab" ); - case Leo: - return i18n( "lion" ); - case Virgo: - return i18n( "virgin" ); - case Libra: - return i18n( "scales" ); - case Scorpio: - return i18n( "scorpion" ); - case Sagittarius: - return i18n( "archer" ); - case Capricorn: - return i18n( "goat" ); - case Aquarius: - return i18n( "water" ); - case Pisces: - return i18n( "fish" ); - default: - case None: - return QString(); - } -} diff --git a/kholidays/zodiac.h b/kholidays/zodiac.h deleted file mode 100644 index 6871df9af..000000000 --- a/kholidays/zodiac.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - This file is part of the kholidays library. - - Copyright (c) 2005-2007 Allen Winter - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KHOLIDAYS_ZODIAC_H -#define KHOLIDAYS_ZODIAC_H - -/** - Represents and manages the Zodiac calendar. - The Tropical and Sidereal Zodiacs are supported. - - A very good description of the Zodiac calendars can be read at the - Wikipedia, - http://en.wikipedia.org/wiki/Zodiac - - Disclaimer: I am by no means a Zodiac expert. I put together this software - based on some quick scanning of documents I found on the WWW. Feel free - to contact me about this code if you have improvements. - - Sign Symbol Birthdates - Tropical Sidereal - Aries ram Mar 21 - Apr 19 Apr 14 - May 14 - Taurus bull Apr 20 - May 20 May 15 - Jun 14 - Gemini twins May 21 - Jun 20 Jun 15 - Jul 16 - Cancer crab Jun 21 - Jul 22 Jul 17 - Aug 16 - Leo lion Jul 23 - Aug 22 Aug 17 - Sep 16 - Virgo virgin Aug 23 - Sep 22 Sep 17 - Oct 17 - Libra scale Sep 23 - Oct 22 Oct 18 - Nov 16 - Scorpio scorpion Oct 23 - Nov 21 Nov 17 - Dec 15 - Sagittarius archer Nov 22 - Dec 21 Dec 16 - Jan 14 - Capricorn goat Dec 22 - Jan 19 Jan 15 - Feb 12 - Aquarius water Jan 20 - Feb 18 Feb 13 - Mar 14 - Pisces fish Feb 19 - Mar 20 Mar 15 - Apr 13 - -*/ - -#include "kholidays_export.h" -#include - -class QDate; - -namespace LibKHolidays { - -class KHOLIDAYS_EXPORT Zodiac -{ - public: - enum ZodiacType { - Tropical, - Sidereal - }; - - enum ZodiacSigns { - Aries, - Taurus, - Gemini, - Cancer, - Leo, - Virgo, - Libra, - Scorpio, - Sagittarius, - Capricorn, - Aquarius, - Pisces, - None - }; - - Zodiac( ZodiacType type ); - ~Zodiac(); - - /** - Return the Zodaic sign for the specified Gregorian date. - The enum 'None' is returned if one of the supported signs - does not occur on the date. - - @param date compute the Zodiac sign for the specified Gregorian date. - */ - ZodiacSigns sign( const QDate &date ) const; - - /** - Return the Zodiac sign as a text string for the specified date. - A null string is returned if one of the supported Zodiac signss does - not occur on the date. - - @param date compute the Zodiac sign for the specified Gregorian date. - */ - QString signStr( const QDate &date ) const; - - /** - Return the string representation of Zodiac sign. - - @param sign Zodiac sign. - */ - static QString signName( ZodiacSigns sign ); - - /** - Convert the Zodiac sign to a Zodiac symbol. - */ - static QString signSymbol( ZodiacSigns sign ); - - private: - ZodiacType mType; -}; - -} - -#endif - diff --git a/kontactinterface/.krazy b/kontactinterface/.krazy deleted file mode 100644 index cc3b3c429..000000000 --- a/kontactinterface/.krazy +++ /dev/null @@ -1 +0,0 @@ -EXTRA style,kdebug diff --git a/kontactinterface/CMakeLists.txt b/kontactinterface/CMakeLists.txt deleted file mode 100644 index cd49f1d7e..000000000 --- a/kontactinterface/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -project(kontactinterfaces) - -add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5601) - -set(kontactinterfaces_LIB_SRCS - core.cpp - plugin.cpp - summary.cpp - uniqueapphandler.cpp) - -kde4_add_library(kontactinterfaces SHARED ${kontactinterfaces_LIB_SRCS}) - -target_link_libraries(kontactinterfaces kdepim ${KDE4_KPARTS_LIBS}) - -set_target_properties(kontactinterfaces PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) - -########### install files ############### - -install(TARGETS kontactinterfaces ${INSTALL_TARGETS_DEFAULT_ARGS}) - -install(FILES kontactplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) diff --git a/kontactinterface/Mainpage.dox b/kontactinterface/Mainpage.dox deleted file mode 100644 index cefc7579f..000000000 --- a/kontactinterface/Mainpage.dox +++ /dev/null @@ -1,24 +0,0 @@ -/*! - * @mainpage Kontact Plugin Interface Library - * - * @section purpose Purpose - * - * This library provides the glue necessary for application "Parts" - * to be embedded as a Kontact component (or plugin). - * - * @authors - * The major authors of this library are (in alphabetical order):\n - * David Faure \\n - * Matthias Hoelzer-Kluepfel \\n - * Daniel Molkentin \\n - * Cornelius Schumacher \ - * - * @maintainers - * Allen Winter \ - * - * @licenses - * @lgpl - */ - -// DOXYGEN_PROJECTNAME = Kontact Plugin Interface Library -// DOXYGEN_REFERENCES = kdecore kdeui diff --git a/kontactinterface/Messages.sh b/kontactinterface/Messages.sh deleted file mode 100644 index 7f90eb1cd..000000000 --- a/kontactinterface/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -$XGETTEXT *.cpp -o $podir/kontactinterfaces.pot diff --git a/kontactinterface/core.cpp b/kontactinterface/core.cpp deleted file mode 100644 index fe1a9d11a..000000000 --- a/kontactinterface/core.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2001 Matthias Hoelzer-Kluepfel - Copyright (c) 2002-2003 Daniel Molkentin - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "core.h" - -#include -#include -#include - -#include -#include - -using namespace Kontact; - -//@cond PRIVATE -class Kontact::Core::Private -{ - Core *const q; - - public: - explicit Private( Core *qq ); - - void slotPartDestroyed( QObject * ); - void checkNewDay(); - - QString lastErrorMessage; - QDate mLastDate; - QMap mParts; -}; - -Core::Private::Private( Core *qq ) - : q( qq ), mLastDate( QDate::currentDate() ) -{ -} -//@endcond - -Core::Core( QWidget *parent, Qt::WindowFlags f ) - : KParts::MainWindow( parent, f ), d( new Private( this ) ) -{ - QTimer *timer = new QTimer( this ); - connect( timer, SIGNAL(timeout()), SLOT(checkNewDay()) ); - timer->start( 1000 * 60 ); -} - -Core::~Core() -{ - delete d; -} - -KParts::ReadOnlyPart *Core::createPart( const char *libname ) -{ - kDebug() << libname; - - QMap::ConstIterator it; - it = d->mParts.constFind( libname ); - if ( it != d->mParts.constEnd() ) { - return it.value(); - } - - kDebug() << "Creating new KPart"; - - KPluginLoader loader( libname ); - kDebug() << loader.fileName(); - KPluginFactory *factory = loader.factory(); - KParts::ReadOnlyPart *part = 0; - if ( factory ) { - part = factory->create( this ); - } - - if (part) { - d->mParts.insert( libname, part ); - QObject::connect( part, SIGNAL(destroyed(QObject *)), - SLOT(slotPartDestroyed(QObject *)) ); - } else { - d->lastErrorMessage = loader.errorString(); - kWarning() << d->lastErrorMessage; - } - - return part; -} - -//@cond PRIVATE -void Core::Private::slotPartDestroyed( QObject *obj ) -{ - // the part was deleted, we need to remove it from the part map to not return - // a dangling pointer in createPart - QMap::Iterator end = mParts.end(); - QMap::Iterator it = mParts.begin(); - for ( ; it != end; ++it ) { - if ( it.value() == obj ) { - mParts.erase( it ); - return; - } - } -} - -void Core::Private::checkNewDay() -{ - if ( mLastDate != QDate::currentDate() ) { - emit q->dayChanged( QDate::currentDate() ); - } - - mLastDate = QDate::currentDate(); -} -//@endcond - -QString Core::lastErrorMessage() const -{ - return d->lastErrorMessage; -} - -#include "core.moc" -// vim: sw=2 sts=2 et tw=80 diff --git a/kontactinterface/core.h b/kontactinterface/core.h deleted file mode 100644 index e39c7a2b3..000000000 --- a/kontactinterface/core.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2001 Matthias Hoelzer-Kluepfel - Copyright (c) 2002-2003 Daniel Molkentin - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ -#ifndef KONTACTINTERFACES_CORE_H -#define KONTACTINTERFACES_CORE_H - -#include "kontactinterfaces_export.h" -#include -#include - -namespace Kontact -{ - -class Plugin; - -/** - This class provides the interface to the Kontact core for the plugins. -*/ -class KONTACTINTERFACES_EXPORT Core : public KParts::MainWindow -{ - Q_OBJECT - public: - virtual ~Core(); - - /** - Selects the given plugin and raises the associated part. - @see selectPlugin(const QString &) - - @param plugin is a pointer to the Kontact Plugin to select. - */ - virtual void selectPlugin( Kontact::Plugin *plugin ) = 0; - - /** - This is an overloaded member function - @see selectPlugin(Kontact::Plugin *) - - @param plugin is the name of the Kontact Plugin select. - */ - virtual void selectPlugin( const QString &plugin ) = 0; - - /** - Returns the pointer list of available plugins. - */ - virtual QList pluginList() const = 0; - - /** - @internal (for Plugin) - */ - KParts::ReadOnlyPart *createPart( const char *libname ); - - /** - @internal (for Plugin) - Tell kontact that a part was loaded - */ - virtual void partLoaded( Plugin *plugin, KParts::ReadOnlyPart *part ) = 0; - - Q_SIGNALS: - /** - Emitted when a new day starts - */ - void dayChanged( const QDate & ); - - protected: - explicit Core( QWidget *parentWidget = 0, Qt::WindowFlags f = KDE_DEFAULT_WINDOWFLAGS ); - - QString lastErrorMessage() const; - - private: - class Private; - Private *const d; - Q_PRIVATE_SLOT( d, void slotPartDestroyed( QObject * ) ) - Q_PRIVATE_SLOT( d, void checkNewDay() ) -}; - -} - -#endif - -// vim: sw=2 sts=2 et tw=80 diff --git a/kontactinterface/kontactinterfaces_export.h b/kontactinterface/kontactinterfaces_export.h deleted file mode 100644 index 98e208925..000000000 --- a/kontactinterface/kontactinterfaces_export.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (C) 2007 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KONTACTINTERFACES_EXPORT_H -#define KONTACTINTERFACES_EXPORT_H - -/* needed for KDE_EXPORT and KDE_IMPORT macros */ -#include - -#ifndef KONTACTINTERFACES_EXPORT -# if defined(MAKE_KONTACTINTERFACES_LIB) - /* We are building this library */ -# define KONTACTINTERFACES_EXPORT KDE_EXPORT -# else - /* We are using this library */ -# define KONTACTINTERFACES_EXPORT KDE_IMPORT -# endif -#endif - -#endif diff --git a/kontactinterface/kontactplugin.desktop b/kontactinterface/kontactplugin.desktop deleted file mode 100644 index 961723723..000000000 --- a/kontactinterface/kontactplugin.desktop +++ /dev/null @@ -1,70 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-KDE-ServiceType=Kontact/Plugin -Name=Kontact Plugin -Name[af]=Kontact inprop module -Name[be]=Утулка Kontact -Name[bg]=Приставка на Kontact -Name[br]=Lugent Kontact -Name[ca]=Connector Kontact -Name[cs]=Modul aplikace Kontact -Name[cy]=Ategyn Kontact -Name[da]=Kontact-plugin -Name[de]=Kontact-Modul -Name[el]=Πρόσθετο Kontact -Name[es]=Complemento de Kontact -Name[et]=Kontacti plugin -Name[eu]=Kontact plugin-a -Name[fa]=وصلۀ Kontact -Name[fi]=Kontact-liitännäinen -Name[fr]=Module Kontact -Name[ga]=Breiseán Kontact -Name[gl]=Engadido do Kontact -Name[he]=תוסף Kontact -Name[hu]=Kontact-bővítőmodul -Name[is]=Kontact íforrit -Name[it]=Plugin Kontact -Name[ja]=Kontact プラグイン -Name[ka]=Kontact მოდული -Name[kk]=Kontact модулі -Name[km]=កម្មវិធី​ជំនួយ Kontact -Name[ko]=Kontact 플러그인 -Name[lt]=Kontact priedas -Name[lv]=Kontact spraudnis -Name[mk]=Приклучок за Контакт -Name[ms]=Plugin Kontact -Name[nb]=Kontact-programtillegg -Name[nds]=Kontact-Moduul -Name[ne]=सम्पर्क प्लगइन -Name[nn]=Kontakt-programtillegg -Name[pa]=ਕੇ-ਸੰਪਰਕ ਪਲੱਗਇਨ -Name[pl]=Wtyczka Kontact -Name[pt]='Plugin' do Kontact -Name[pt_BR]=Plug-in do Kontact -Name[ro]=Modul Kontact -Name[ru]=Модуль Kontact -Name[se]=Kontact-lassemoduvla -Name[sl]=Vstavek za Kontact -Name[sv]=Kontact-insticksprogram -Name[ta]=சொருகுப்பொருளை தொடர்புக்கொள் -Name[tg]=Модули Kontact -Name[tr]=Kontact Eklentisi -Name[uk]=Втулок Kontact -Name[uz]=Kontact uchun plagin -Name[uz@cyrillic]=Kontact учун плагин -Name[x-test]=xxKontact Pluginxx -Name[zh_CN]=Kontact 插件 -Name[zh_TW]=Kontact 外掛程式 - -[PropertyDef::X-KDE-KontactPluginVersion] -Type=int -[PropertyDef::X-KDE-KontactPartLibraryName] -Type=QString -[PropertyDef::X-KDE-KontactPartExecutableName] -Type=QString -[PropertyDef::X-KDE-KontactPartLoadOnStart] -Type=bool -[PropertyDef::X-KDE-KontactPluginHasSummary] -Type=bool -[PropertyDef::X-KDE-KontactPluginHasPart] -Type=bool diff --git a/kontactinterface/plugin.cpp b/kontactinterface/plugin.cpp deleted file mode 100644 index 1fbaee4de..000000000 --- a/kontactinterface/plugin.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2001 Matthias Hoelzer-Kluepfel - Copyright (c) 2002-2003 Daniel Molkentin - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "plugin.h" -#include "core.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -using namespace Kontact; - -/** - Private class that helps to provide binary compatibility between releases. - @internal -*/ -//@cond PRIVATE -class Plugin::Private -{ - public: - - void partDestroyed(); - - Core *core; - QList *newActions; - QList *syncActions; - QString identifier; - QString title; - QString icon; - QString executableName; - QString serviceName; - QByteArray partLibraryName; - bool hasPart; - KParts::ReadOnlyPart *part; - bool disabled; -}; -//@endcond - -Plugin::Plugin( Core *core, QObject *parent, const char *name ) - : KXMLGUIClient( core ), QObject( parent ), d( new Private ) -{ - setObjectName( name ); - core->factory()->addClient( this ); - KGlobal::locale()->insertCatalog( name ); - - d->core = core; - d->newActions = new QList; - d->syncActions = new QList; - d->hasPart = true; - d->part = 0; - d->disabled = false; -} - -Plugin::~Plugin() -{ - delete d->part; - delete d; -} - -void Plugin::setIdentifier( const QString &identifier ) -{ - d->identifier = identifier; -} - -QString Plugin::identifier() const -{ - return d->identifier; -} - -void Plugin::setTitle( const QString &title ) -{ - d->title = title; -} - -QString Plugin::title() const -{ - return d->title; -} - -void Plugin::setIcon( const QString &icon ) -{ - d->icon = icon; -} - -QString Plugin::icon() const -{ - return d->icon; -} - -void Plugin::setExecutableName( const QString &bin ) -{ - d->executableName = bin; -} - -QString Plugin::executableName() const -{ - return d->executableName; -} - -void Plugin::setPartLibraryName( const QByteArray &libName ) -{ - d->partLibraryName = libName; -} - -bool Plugin::createDBUSInterface( const QString &serviceType ) -{ - Q_UNUSED( serviceType ); - return false; -} - -bool Plugin::isRunningStandalone() -{ - return false; -} - -KParts::ReadOnlyPart *Plugin::loadPart() -{ - return core()->createPart( d->partLibraryName ); -} - -const KAboutData *Plugin::aboutData() -{ - KPluginLoader loader( d->partLibraryName ); - KPluginFactory *factory = loader.factory(); - kDebug() << "filename:" << loader.fileName(); - kDebug() << "libname:" << d->partLibraryName; - - if ( factory ) { - if ( factory->componentData().isValid() ) { - kDebug() << "returning factory component aboutdata"; - return factory->componentData().aboutData(); - } else { - // If the componentData of the factory is invalid, the likely cause is that - // the part has not been ported to use K_PLUGIN_FACTORY/K_EXPORT_PLUGIN yet. - // In that case, fallback to the old method of loading component data, which - // does only work for old-style parts. - - kDebug() << "Unable to load component data for" << loader.fileName() - << "trying to use the old style plugin system now."; - const KComponentData instance = - KParts::Factory::partComponentDataFromLibrary( d->partLibraryName ); - if ( instance.isValid() ) { - return instance.aboutData(); - } else { - kDebug() << "Invalid instance, unable to get about information!"; - } - } - } - - kError() << "Cannot load instance for" << title(); - return 0; -} - -KParts::ReadOnlyPart *Plugin::part() -{ - if ( !d->part ) { - d->part = createPart(); - if ( d->part ) { - connect( d->part, SIGNAL(destroyed()), SLOT(partDestroyed()) ); - core()->partLoaded( this, d->part ); - } - } - return d->part; -} - -QString Plugin::tipFile() const -{ - return QString(); -} - -QString Plugin::registerClient() -{ - if ( d->serviceName.isEmpty() ) { - d->serviceName = "org.kde." + objectName().toLatin1(); -#ifdef Q_WS_WIN - const QString pid = QString::number( getpid() ); - d->serviceName.append( ".unique-" + pid ); -#endif - QDBusConnection::sessionBus().registerService( d->serviceName ); - } - return d->serviceName; -} - -int Plugin::weight() const -{ - return 0; -} - -void Plugin::insertNewAction( KAction *action ) -{ - d->newActions->append( action ); -} - -void Plugin::insertSyncAction( KAction *action ) -{ - d->syncActions->append( action ); -} - -QList *Plugin::newActions() const -{ - return d->newActions; -} - -QList *Plugin::syncActions() const -{ - return d->syncActions; -} - -QStringList Plugin::invisibleToolbarActions() const -{ - return QStringList(); -} - -bool Plugin::canDecodeMimeData( const QMimeData *data ) -{ - Q_UNUSED( data ); - return false; -} - -Core *Plugin::core() const -{ - return d->core; -} - -void Plugin::select() -{ -} - -void Plugin::configUpdated() -{ -} - -//@cond PRIVATE -void Plugin::Private::partDestroyed() -{ - part = 0; -} -//@endcond - -void Plugin::slotConfigUpdated() -{ - configUpdated(); -} - -void Plugin::bringToForeground() -{ - if ( d->executableName.isEmpty() ) { - return; - } -#ifdef Q_WS_WIN - KPIM::Utils::activateWindowForProcess( d->executableName ); -#else - KRun::runCommand( d->executableName, 0 ); -#endif -} - -Summary *Plugin::createSummaryWidget( QWidget *parent ) -{ - Q_UNUSED( parent ); - return 0; -} - -bool Plugin::showInSideBar() const -{ - return d->hasPart; -} - -void Plugin::setShowInSideBar( bool hasPart ) -{ - d->hasPart = hasPart; -} - -bool Plugin::queryClose() const -{ - return true; -} - -void Plugin::setDisabled( bool disabled ) -{ - d->disabled = disabled; -} - -bool Plugin::disabled() const -{ - return d->disabled; -} - -void Plugin::virtual_hook( int, void * ) -{ - //BASE::virtual_hook( id, data ); -} - -#include "plugin.moc" - -// vim: sw=2 et sts=2 tw=80 diff --git a/kontactinterface/plugin.h b/kontactinterface/plugin.h deleted file mode 100644 index 4f94e027f..000000000 --- a/kontactinterface/plugin.h +++ /dev/null @@ -1,299 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2001 Matthias Hoelzer-Kluepfel - Copyright (c) 2002-2003 Daniel Molkentin - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KONTACTINTERFACES_PLUGIN_H -#define KONTACTINTERFACES_PLUGIN_H - -#include "kontactinterfaces_export.h" - -#include -#include - -#include -#include - -class KAboutData; -class KAction; -class KConfig; -class KConfigGroup; -class QDropEvent; -class QMimeData; -class QStringList; -class QWidget; -namespace KParts { - class ReadOnlyPart; -} - -/** - Exports Kontact plugin. - */ -#define EXPORT_KONTACT_PLUGIN( pluginclass, pluginname ) \ -class Instance \ -{ \ - public: \ - static QObject *createInstance( QWidget *, QObject *parent, const QVariantList &list ) \ - { return new pluginclass( static_cast( parent ), list ); } \ -}; \ -K_PLUGIN_FACTORY( KontactPluginFactory, registerPlugin< pluginclass > \ - ( QString(), Instance::createInstance ); ) \ -K_EXPORT_PLUGIN( KontactPluginFactory( "kontact_" #pluginname "plugin" ) ) - -/** - Increase this version number whenever you make a change in the API. - */ -#define KONTACT_PLUGIN_VERSION 7 - -namespace Kontact -{ - -class Core; -class Summary; - -/** - Base class for all Plugins in Kontact. Inherit from it - to get a plugin. It can insert an icon into the sidepane, - add widgets to the widgetstack and add menu items via XMLGUI. - */ -class KONTACTINTERFACES_EXPORT Plugin : public QObject, virtual public KXMLGUIClient -{ - Q_OBJECT - - public: - /** - Creates a new Plugin, note that name parameter name is required if - you want your plugin to do dcop via it's own instance of - DCOPClient by calling dcopClient. - @note name MUST be the name of the application that - provides the part! This is the name used for DCOP registration. - It's ok to have several plugins using the same application name. - */ - Plugin( Core *core, QObject *parent, const char *name ); - - virtual ~Plugin(); - - /** - Sets the identifier. - */ - void setIdentifier( const QString &identifier ); - - /** - Returns the identifier. It is used as argument for several - methods of Kontacts core. - */ - QString identifier() const; - - /** - Sets the localized title. - */ - void setTitle( const QString &title ); - - /** - Returns the localized title. - */ - QString title() const; - - /** - Sets the icon name. - */ - void setIcon( const QString &icon ); - - /** - Returns the icon name. - */ - QString icon() const; - - /** - Sets the name of executable (if existent). - */ - void setExecutableName( const QString &bin ); - - /** - Returns the name of the binary (if existent). - */ - QString executableName() const; - - /** - Set name of library which contains the KPart used by this plugin. - */ - void setPartLibraryName( const QByteArray & ); - - /** - Create the D-Bus interface for the given @p serviceType, if this - plugin provides it. Return false otherwise. - */ - virtual bool createDBUSInterface( const QString &serviceType ); - - /** - Reimplement this method and return whether a standalone application - is still running. This is only required if your part is also available - as standalone application. - */ - virtual bool isRunningStandalone(); - - /** - Reimplement this method if your application needs a different approach to be brought - in the foreground. The default behaviour is calling the binary. - This is only required if your part is also available as standalone application. - */ - virtual void bringToForeground(); - - /** - Reimplement this method if you want to add your credits to the Kontact - about dialog. - */ - virtual const KAboutData *aboutData(); - - /** - You can use this method if you need to access the current part. You can be - sure that you always get the same pointer as long as the part has not been - deleted. - */ - KParts::ReadOnlyPart *part(); - - /** - Reimplement this method and return the a path relative to "data" to the tips file. - The tips file contains hints/tips that are displayed at the beginning of the program - as "tip of the day". It has nothing to do with tooltips. - */ - virtual QString tipFile() const; - - /** - This function is called when the plugin is selected by the user before the - widget of the KPart belonging to the plugin is raised. - */ - virtual void select(); - - /** - This function is called whenever the config dialog has been closed - successfully. - */ - virtual void configUpdated(); - - /** - Reimplement this method if you want to add a widget for your application - to Kontact's summary page. - */ - virtual Summary *createSummaryWidget( QWidget *parent ); - - /** - Returns whether the plugin provides a part that should be shown in the sidebar. - */ - virtual bool showInSideBar() const; - - /** - Set if the plugin provides a part that should be shown in the sidebar. - */ - void setShowInSideBar( bool hasPart ); - - /** - Reimplement this method if you want to add checks before closing the - main kontact window. Return true if it's OK to close the window. - If any loaded plugin returns false from this method, then the - main kontact window will not close. - */ - virtual bool queryClose() const; - - QString registerClient(); - - /** - Return the weight of the plugin. The higher the weight the lower it will - be displayed in the sidebar. The default implementation returns 0. - */ - virtual int weight() const; - - /** - Insert "New" action. - */ - void insertNewAction( KAction *action ); - - /** - Insert "Sync" action. - */ - void insertSyncAction( KAction *action ); - - /** - FIXME: write API doc for Plugin::newActions(). - */ - QList* newActions() const; - - /** - FIXME: write API doc for Plugin::syncActions(). - */ - QList* syncActions() const; - - /** - Returns a list of action name which shall be hidden in the main toolbar. - */ - virtual QStringList invisibleToolbarActions() const; - - /** - Return, if the plugin can handle the drag object of the given mime type. - */ - virtual bool canDecodeMimeData( const QMimeData *data ); - - /** - Process drop event. - */ - virtual void processDropEvent( QDropEvent * ) {} - - /** - * Session management: read properties - */ - virtual void readProperties( const KConfigGroup & ) {} - - /** - * Session management: save properties - */ - virtual void saveProperties( KConfigGroup & ) {} - - Core *core() const; - - bool disabled() const; - void setDisabled( bool v ); - - public Q_SLOTS: - /** - internal usage - */ - void slotConfigUpdated(); - - protected: - /** - Reimplement and return the part here. Reimplementing createPart() is - mandatory! - */ - virtual KParts::ReadOnlyPart *createPart() = 0; - - KParts::ReadOnlyPart *loadPart(); - - virtual void virtual_hook( int id, void *data ); - - private: - class Private; - Private *const d; - Q_PRIVATE_SLOT( d, void partDestroyed() ) -}; - -} - -#endif diff --git a/kontactinterface/summary.cpp b/kontactinterface/summary.cpp deleted file mode 100644 index 02b3af725..000000000 --- a/kontactinterface/summary.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2003 Cornelius Schumacher - Copyright (c) 2003 Daniel Molkentin - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "summary.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -using namespace Kontact; - -//@cond PRIVATE -namespace Kontact { -class SummaryMimeData : public QMimeData -{ - public: - virtual bool hasFormat( const QString &format ) const - { - if ( format == "application/x-kontact-summary" ) { - return true; - } - return false; - } -}; -} -//@endcond - -//@cond PRIVATE -class Summary::Private -{ - public: - KStatusBar *mStatusBar; - QPoint mDragStartPoint; -}; -//@endcond - -Summary::Summary( QWidget *parent ) - : QWidget( parent ), d( new Private ) -{ - setFont( KGlobalSettings::generalFont() ); - setAcceptDrops( true ); -} - -Summary::~Summary() -{ - delete d; -} - -int Summary::summaryHeight() const -{ - return 1; -} - -QWidget *Summary::createHeader( QWidget *parent, const QString &iconname, const QString &heading ) -{ - setStyleSheet( "KHBox {" - "border: 1px solid palette(window);" - "border-top: 0px solid white;" - "border-left: 0px solid white;" - "border-right: 0px solid white;" - "font: bold large;" - "padding: 2px;" - "}" - "KHBox > QLabel { font: bold larger; } " ); - - KHBox *hbox = new KHBox( parent ); - //hbox->setMargin( 2 ); - //hbox->setAutoFillBackground( true ); - - QLabel *label = new QLabel( hbox ); - label->setPixmap( KIconLoader::global()->loadIcon( iconname, KIconLoader::Toolbar ) ); - - label->setFixedSize( label->sizeHint() ); - label->setAcceptDrops( true ); - - label = new QLabel( heading, hbox ); - label->setAlignment( Qt::AlignLeft | Qt::AlignVCenter ); - label->setIndent( KDialog::spacingHint() ); - - hbox->setMaximumHeight( hbox->minimumSizeHint().height() ); - - return hbox; -} - -QStringList Summary::configModules() const -{ - return QStringList(); -} - -void Summary::updateSummary( bool force ) -{ - Q_UNUSED( force ); -} - -void Summary::mousePressEvent( QMouseEvent *event ) -{ - d->mDragStartPoint = event->pos(); - - QWidget::mousePressEvent( event ); -} - -void Summary::mouseMoveEvent( QMouseEvent *event ) -{ - if ( ( event->buttons() & Qt::LeftButton ) && - ( event->pos() - d->mDragStartPoint ).manhattanLength() > 4 ) { - - QDrag *drag = new QDrag( this ); - drag->setMimeData( new SummaryMimeData() ); - drag->setObjectName( "SummaryWidgetDrag" ); - - QPixmap pm = QPixmap::grabWidget( this ); - if ( pm.width() > 300 ) { - pm = QPixmap::fromImage( - pm.toImage().scaled( 300, 300, Qt::KeepAspectRatio, Qt::SmoothTransformation ) ); - } - - QPainter painter; - painter.begin( &pm ); - painter.setPen( QPalette::AlternateBase ); - painter.drawRect( 0, 0, pm.width(), pm.height() ); - painter.end(); - drag->setPixmap( pm ); - drag->start( Qt::MoveAction ); - } else { - QWidget::mouseMoveEvent( event ); - } -} - -void Summary::dragEnterEvent( QDragEnterEvent *event ) -{ - if ( event->mimeData()->hasFormat( "application/x-kontact-summary" ) ) { - event->acceptProposedAction(); - } -} - -void Summary::dropEvent( QDropEvent *event ) -{ - int alignment = ( event->pos().y() < ( height() / 2 ) ? Qt::AlignTop : Qt::AlignBottom ); - emit summaryWidgetDropped( this, event->source(), alignment ); -} - -#include "summary.moc" diff --git a/kontactinterface/summary.h b/kontactinterface/summary.h deleted file mode 100644 index 21deb9300..000000000 --- a/kontactinterface/summary.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef KONTACTINTERFACES_SUMMARY_H -#define KONTACTINTERFACES_SUMMARY_H - -#include "kontactinterfaces_export.h" - -#include - -class KStatusBar; -class QMouseEvent; -class QDragEnterEvent; -class QDropEvent; - -namespace Kontact -{ - -/** - Summary widget for display in the Summary View plugin. - */ -class KONTACTINTERFACES_EXPORT Summary : public QWidget -{ - Q_OBJECT - public: - explicit Summary( QWidget *parent ); - - virtual ~Summary(); - - /** - Return logical height of summary widget. This is used to calculate how - much vertical space relative to other summary widgets this widget will - use in the summary view. - */ - virtual int summaryHeight() const; - - /** - Creates a heading for a typical summary view with an icon and a heading. - */ - QWidget *createHeader( QWidget *parent, const QString &iconname, const QString &heading ); - - /** - Return list of strings identifying configuration modules for this summary - part. The string has to be suitable for being passed to - KCMultiDialog::addModule(). - */ - virtual QStringList configModules() const; - - public Q_SLOTS: - virtual void configChanged() {} - - /** - This is called if the displayed information should be updated. - @param force true if the update was requested by the user - */ - virtual void updateSummary( bool force = false ); - - Q_SIGNALS: - void message( const QString &message ); - void summaryWidgetDropped( QWidget *target, QWidget *widget, int alignment ); - - protected: - virtual void mousePressEvent( QMouseEvent * ); - virtual void mouseMoveEvent( QMouseEvent * ); - virtual void dragEnterEvent( QDragEnterEvent * ); - virtual void dropEvent( QDropEvent * ); - - private: - class Private; - Private *const d; -}; - -} - -#endif diff --git a/kontactinterface/uniqueapphandler.cpp b/kontactinterface/uniqueapphandler.cpp deleted file mode 100644 index 9ee2c5d1c..000000000 --- a/kontactinterface/uniqueapphandler.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2003,2008 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "uniqueapphandler.h" -#include -#include "core.h" -#include "libkdepim/utils.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifdef Q_WS_WIN -# include -#endif - -/* - Test plan for the various cases of interaction between standalone apps and kontact: - - 1) start kontact, select "Mail". - 1a) type "korganizer" -> it switches to korganizer - 1b) type "kmail" -> it switches to kmail - 1c) type "kaddressbook" -> it switches to kaddressbook - 1d) type "kmail foo@kde.org" -> it opens a kmail composer, without switching - 1e) type "knode" -> it switches to knode [unless configured to be external] - 1f) type "kaddressbook --new-contact" -> it opens a kaddressbook contact window - 1g) type "knode news://foobar/group" -> it pops up "can't resolve hostname" - - 2) close kontact. Launch kmail. Launch kontact again. - 2a) click "Mail" icon -> kontact doesn't load a part, but activates the kmail window - 2b) type "kmail foo@kde.org" -> standalone kmail opens composer. - 2c) close kmail, click "Mail" icon -> kontact loads the kmail part. - 2d) type "kmail" -> kontact is brought to front - - 3) close kontact. Launch korganizer, then kontact. - 3a) both Todo and Calendar activate the running korganizer. - 3b) type "korganizer" -> standalone korganizer is brought to front - 3c) close korganizer, click Calendar or Todo -> kontact loads part. - 3d) type "korganizer" -> kontact is brought to front - - 4) close kontact. Launch kaddressbook, then kontact. - 4a) "Contacts" icon activate the running kaddressbook. - 4b) type "kaddressbook" -> standalone kaddressbook is brought to front - 4c) close kaddressbook, type "kaddressbook -a foo@kde.org" -> kontact loads part and opens editor - 4d) type "kaddressbook" -> kontact is brought to front - - 5) close kontact. Launch knode, then kontact. - 5a) "News" icon activate the running knode. - 5b) type "knode" -> standalone knode is brought to front - 5c) close knode, type "knode news://foobar/group" -> kontact loads knode and pops up msgbox - 5d) type "knode" -> kontact is brought to front - - 6) start "kontact --module summaryplugin" - 6a) type "qdbus org.kde.kmail /kmail_PimApplication newInstance '' ''" -> - kontact switches to kmail (#103775) - 6b) type "kmail" -> kontact is brought to front - 6c) type "kontact" -> kontact is brought to front - 6d) type "kontact --module summaryplugin" -> kontact switches to summary - -*/ - -using namespace Kontact; - -//@cond PRIVATE -class UniqueAppHandler::Private -{ - public: - Plugin *mPlugin; -}; -//@endcond - -UniqueAppHandler::UniqueAppHandler( Plugin *plugin ) - : d( new Private ) -{ - //kDebug() << "plugin->objectName():" << plugin->objectName(); - - d->mPlugin = plugin; - QDBusConnection session = QDBusConnection::sessionBus(); - const QString appName = plugin->objectName(); - session.registerService( "org.kde." + appName ); - const QString objectName = QString( '/' ) + appName + "_PimApplication"; - session.registerObject( objectName, this, QDBusConnection::ExportAllSlots ); -} - -UniqueAppHandler::~UniqueAppHandler() -{ - delete d; -} - -// DBUS call -int UniqueAppHandler::newInstance( const QByteArray &asn_id, const QByteArray &args ) -{ - if ( !asn_id.isEmpty() ) { - kapp->setStartupId( asn_id ); - } - - KCmdLineArgs::reset(); // forget options defined by other "applications" - loadCommandLineOptions(); // implemented by plugin - - // This bit is duplicated from KUniqueApplicationAdaptor::newInstance() - QDataStream ds( args ); - KCmdLineArgs::loadAppArgs( ds ); - - return newInstance(); -} - -static QWidget *s_mainWidget = 0; - -// Plugin-specific newInstance implementation, called by above method -int Kontact::UniqueAppHandler::newInstance() -{ - if ( s_mainWidget ) { - s_mainWidget->show(); - KWindowSystem::forceActiveWindow( s_mainWidget->winId() ); - KStartupInfo::appStarted(); - } - - // Then ensure the part appears in kontact - d->mPlugin->core()->selectPlugin( d->mPlugin ); - return 0; -} - -Plugin *UniqueAppHandler::plugin() const -{ - return d->mPlugin; -} - -bool Kontact::UniqueAppHandler::load() -{ - (void)d->mPlugin->part(); // load the part without bringing it to front - return true; -} - -//@cond PRIVATE -class UniqueAppWatcher::Private -{ - public: - UniqueAppHandlerFactoryBase *mFactory; - Plugin *mPlugin; - bool mRunningStandalone; -}; -//@endcond - -UniqueAppWatcher::UniqueAppWatcher( UniqueAppHandlerFactoryBase *factory, Plugin *plugin ) - : QObject( plugin ), d( new Private ) -{ - d->mFactory = factory; - d->mPlugin = plugin; - - // The app is running standalone if 1) that name is known to D-Bus - const QString serviceName = "org.kde." + plugin->objectName(); - d->mRunningStandalone = - QDBusConnection::sessionBus().interface()->isServiceRegistered( serviceName ); -#ifdef Q_WS_WIN - if ( d->mRunningStandalone ) { - QList pids; - KPIM::Utils::getProcessesIdForName( plugin->objectName(), pids ); - const int mypid = getpid(); - bool processExits = false; - foreach ( int pid, pids ) { - if ( mypid != pid ) { - processExits = true; - break; - } - } - if ( !processExits ) { - d->mRunningStandalone = false; - } - } -#endif - - QString owner = QDBusConnection::sessionBus().interface()->serviceOwner( serviceName ); - if ( d->mRunningStandalone && ( owner == QDBusConnection::sessionBus().baseService() ) ) { - d->mRunningStandalone = false; - } - //kDebug() << " plugin->objectName()=" << plugin->objectName() - // << " running standalone:" << d->mRunningStandalone; - - if ( d->mRunningStandalone ) { - QObject::connect( QDBusConnection::sessionBus().interface(), - SIGNAL(serviceOwnerChanged(QString,QString,QString)), - this, SLOT(slotApplicationRemoved(QString,QString,QString)) ); - } else { - d->mFactory->createHandler( d->mPlugin ); - } -} - -UniqueAppWatcher::~UniqueAppWatcher() -{ - delete d->mFactory; - delete d; -} - -bool UniqueAppWatcher::isRunningStandalone() const -{ - return d->mRunningStandalone; -} - -void Kontact::UniqueAppWatcher::slotApplicationRemoved( const QString &name, - const QString &oldOwner, - const QString &newOwner ) -{ - if ( oldOwner.isEmpty() || !newOwner.isEmpty() ) { - return; - } - - const QString serviceName = "org.kde." + d->mPlugin->objectName(); - if ( name == serviceName && d->mRunningStandalone ) { - d->mFactory->createHandler( d->mPlugin ); - d->mRunningStandalone = false; - } -} - -void Kontact::UniqueAppHandler::setMainWidget( QWidget *widget ) -{ - s_mainWidget = widget; -} - -#include "uniqueapphandler.moc" diff --git a/kontactinterface/uniqueapphandler.h b/kontactinterface/uniqueapphandler.h deleted file mode 100644 index a28f20e33..000000000 --- a/kontactinterface/uniqueapphandler.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - This file is part of the KDE Kontact Plugin Interface Library. - - Copyright (c) 2003,2008 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KONTACTINTERFACES_UNIQUEAPPHANDLER_H -#define KONTACTINTERFACES_UNIQUEAPPHANDLER_H - -#include "kontactinterfaces_export.h" -#include "plugin.h" - -namespace Kontact -{ - -/** - * D-Bus Object that has the name of the standalone application (e.g. "kmail") - * and implements newInstance() so that running the separate application does - * the right thing when kontact is running. - * By default this means simply bringing the main window to the front, - * but newInstance can be reimplemented. - */ -class KONTACTINTERFACES_EXPORT UniqueAppHandler : public QObject -{ - Q_OBJECT - // We implement the KUniqueApplication interface - Q_CLASSINFO( "D-Bus Interface", "org.kde.KUniqueApplication" ) - - public: - UniqueAppHandler( Plugin *plugin ); - virtual ~UniqueAppHandler(); - - /// This must be reimplemented so that app-specific command line options can be parsed - virtual void loadCommandLineOptions() = 0; - - Plugin *plugin() const; - - // for kontact - static void setMainWidget( QWidget *widget ); - - public Q_SLOTS: // DBUS methods - int newInstance( const QByteArray &asn_id, const QByteArray &args ); - bool load(); - - protected: - virtual int newInstance(); - - private: - class Private; - Private *const d; -}; - -/// Base class for UniqueAppHandler -class UniqueAppHandlerFactoryBase -{ - public: - virtual ~UniqueAppHandlerFactoryBase(){} - virtual UniqueAppHandler *createHandler( Plugin * ) = 0; -}; - -/** - * Used by UniqueAppWatcher below, to create the above UniqueAppHandler object - * when necessary. - * The template argument is the UniqueAppHandler-derived class. - * This allows to remove the need to subclass UniqueAppWatcher. - */ -template class UniqueAppHandlerFactory : public UniqueAppHandlerFactoryBase -{ - public: - virtual UniqueAppHandler *createHandler( Plugin *plugin ) { - plugin->registerClient(); - return new T( plugin ); - } -}; - -/** - * If the standalone application is running by itself, we need to watch - * for when the user closes it, and activate the uniqueapphandler then. - * This prevents, on purpose, that the standalone app can be restarted. - * Kontact takes over from there. - * - */ -class KONTACTINTERFACES_EXPORT UniqueAppWatcher : public QObject -{ - Q_OBJECT - - public: - /** - * Create an instance of UniqueAppWatcher, which does everything necessary - * for the "unique application" behavior: create the UniqueAppHandler as soon - * as possible, i.e. either right now or when the standalone app is closed. - * - * @param factory templatized factory to create the handler. Example: - * ... Note that the watcher takes ownership of the factory. - * @param plugin is the plugin application - */ - UniqueAppWatcher( UniqueAppHandlerFactoryBase *factory, Plugin *plugin ); - - virtual ~UniqueAppWatcher(); - - bool isRunningStandalone() const; - - private Q_SLOTS: - void slotApplicationRemoved( const QString &name, const QString &oldOwner, - const QString &newOwner ); - - private: - class Private; - Private *const d; -}; - -} // namespace - -#endif - diff --git a/kpimtextedit/richtextbuilders/CMakeLists.txt b/kpimtextedit/richtextbuilders/CMakeLists.txt deleted file mode 100644 index 5b37e6650..000000000 --- a/kpimtextedit/richtextbuilders/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -PROJECT( krichtexteditor ) -FIND_PACKAGE(KDE4 REQUIRED) -INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ) - -SET(krichtexteditorSources - main.cpp - krichtexteditor.cpp - kmarkupdirector.cpp - kmarkupdirector_p.cpp - ktexthtmlbuilder.cpp - kplaintextmarkupbuilder.cpp - mediawikimarkupbuilder.cpp - bbcodebuilder.cpp -) - -KDE4_ADD_EXECUTABLE(krichtexteditor ${krichtexteditorSources} ) -TARGET_LINK_LIBRARIES(krichtexteditor ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ) - -install(TARGETS krichtexteditor DESTINATION ${BIN_INSTALL_DIR}) -install(FILES - krichtexteditorui.rc - DESTINATION ${DATA_INSTALL_DIR}/krichtexteditor) - - - diff --git a/kpimtextedit/richtextbuilders/Mainpage.dox b/kpimtextedit/richtextbuilders/Mainpage.dox deleted file mode 100644 index 76a640e5c..000000000 --- a/kpimtextedit/richtextbuilders/Mainpage.dox +++ /dev/null @@ -1,3 +0,0 @@ -/** -* Rich text builders for KRichTextEdit classes. -*/ diff --git a/kpimtextedit/richtextbuilders/bbcodebuilder.cpp b/kpimtextedit/richtextbuilders/bbcodebuilder.cpp deleted file mode 100644 index 05090dcac..000000000 --- a/kpimtextedit/richtextbuilders/bbcodebuilder.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - - - -#include "bbcodebuilder.h" -#include - -BBCodeBuilder::BBCodeBuilder() -{ - - currentAlignment = Qt::AlignLeft; //Default value -} - -void BBCodeBuilder::beginStrong() -{ - m_text.append("[B]"); -} -void BBCodeBuilder::endStrong() -{ - m_text.append("[/B]"); -} -void BBCodeBuilder::beginEmph() -{ - m_text.append("[I]"); -} -void BBCodeBuilder::endEmph() -{ - m_text.append("[/I]"); -} -void BBCodeBuilder::beginUnderline() -{ - m_text.append("[U]"); -} -void BBCodeBuilder::endUnderline() -{ - m_text.append("[/U]"); -} -void BBCodeBuilder::beginStrikeout() -{ - m_text.append("[S]"); -} -void BBCodeBuilder::endStrikeout() -{ - m_text.append("[/S]"); -} -void BBCodeBuilder::beginForeground(const QBrush &brush) -{ - m_text.append(QString("[COLOR=%1]").arg(brush.color().name())); -} -void BBCodeBuilder::endForeground() -{ - m_text.append("[/COLOR]"); -} - -// Background colour not supported by BBCode. - -void BBCodeBuilder::beginAnchor(const QString &href, const QString &name) -{ - m_text.append(QString("[URL=%1]").arg(href)); -} -void BBCodeBuilder::endAnchor() -{ - m_text.append("[/URL]"); -} - -// Font family not supported by BBCode. - -void BBCodeBuilder::beginFontPointSize(int size) -{ - m_text.append(QString("[SIZE=%1]").arg(QString::number(size))); -} -void BBCodeBuilder::endFontPointSize() -{ - m_text.append("[/SIZE]"); -} - -void BBCodeBuilder::beginParagraph(Qt::Alignment a, qreal top, qreal bottom, qreal left, qreal right) -{ - Q_UNUSED(top); - Q_UNUSED(bottom); - Q_UNUSED(left); - Q_UNUSED(right); - if (a & Qt::AlignRight) { - m_text.append("\n[Right]"); - } else if (a & Qt::AlignHCenter) { - m_text.append("\n[CENTER]"); - } - // LEFT is also supported in BBCode, but ignored. - currentAlignment = a; -} -void BBCodeBuilder::endParagraph() -{ - if (currentAlignment & Qt::AlignRight) { - m_text.append("\n[/Right]\n"); - } else if (currentAlignment & Qt::AlignHCenter) { - m_text.append("\n[/CENTER]\n"); - } else { - m_text.append("\n"); - } - currentAlignment = Qt::AlignLeft; - -} -void BBCodeBuilder::addNewline() -{ - m_text.append("\n"); -} - -void BBCodeBuilder::insertImage(const QString &src, qreal width, qreal height) -{ - Q_UNUSED(width); - Q_UNUSED(height); - m_text.append(QString("[IMG]%1[/IMG]").arg(src)); -} - -void BBCodeBuilder::beginList(QTextListFormat::Style type) -{ - switch (type) { - case QTextListFormat::ListDisc: - case QTextListFormat::ListCircle: - case QTextListFormat::ListSquare: - m_text.append("[LIST]\n"); // Unordered lists are all disc type in BBCode. - break; - case QTextListFormat::ListDecimal: - m_text.append("[LIST=1]\n"); - break; - case QTextListFormat::ListLowerAlpha: - m_text.append("[LIST=a]\n"); - break; - case QTextListFormat::ListUpperAlpha: - m_text.append("[LIST=A]\n"); - break; - default: - break; - } -} - -void BBCodeBuilder::endList() -{ - m_text.append("[/LIST]\n"); -} - - -void BBCodeBuilder::beginListItem() -{ - m_text.append("[*] "); -} - -void BBCodeBuilder::beginSuperscript() -{ - m_text.append("[SUP]"); -} - -void BBCodeBuilder::endSuperscript() -{ - m_text.append("[/SUP]"); -} - -void BBCodeBuilder::beginSubscript() -{ - m_text.append("[SUB]"); -} - -void BBCodeBuilder::endSubscript() -{ - m_text.append("[/SUB]"); -} - - -void BBCodeBuilder::beginTable(qreal, qreal, const QString &) -{ - m_text.append("[TABLE]\n"); -} - -void BBCodeBuilder::beginTableRow() -{ - m_text.append("[/TABLE]"); -} - - -void BBCodeBuilder::appendLiteralText(const QString &text) -{ - m_text.append(escape(text)); -} - -const QString BBCodeBuilder::escape(const QString &s) -{ - if (s.contains("[")) { - return QString("[NOPARSE]" + s + "[/NOPARSE]"); - } - return s; -} - -QString& BBCodeBuilder::getResult() -{ - return m_text; -} - diff --git a/kpimtextedit/richtextbuilders/bbcodebuilder.h b/kpimtextedit/richtextbuilders/bbcodebuilder.h deleted file mode 100644 index 3d6ae0208..000000000 --- a/kpimtextedit/richtextbuilders/bbcodebuilder.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef BBCODEBUILDER_H -#define BBCODEBUILDER_H - -#include "kabstractmarkupbuilder.h" -#include - -/** -Creates BBCode from a QTextDocument -*/ -class BBCodeBuilder : public KAbstractMarkupBuilder -{ -public: - - /** - Creates a new BBCodeBuilder. - */ - BBCodeBuilder(); - - virtual void beginStrong(); - virtual void endStrong(); - virtual void beginEmph(); - virtual void endEmph(); - virtual void beginUnderline(); - virtual void endUnderline(); - virtual void beginStrikeout(); - virtual void endStrikeout(); - virtual void beginForeground(const QBrush &brush); - virtual void endForeground(); - - // Background colour not supported by BBCode. - - virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()); - virtual void endAnchor(); - - // Font family not supported by BBCode. - - /** - Begin an element of font size @p size. Note that this size is in pixels, and must be converted before - it is suitable for use in BBCode. - @param size The size of font to begin. - */ - virtual void beginFontPointSize(int size); - virtual void endFontPointSize(); - - virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0); - - virtual void endParagraph(); - virtual void addNewline(); - - virtual void insertImage(const QString &src, qreal width, qreal height); - - virtual void beginList(QTextListFormat::Style type); - - virtual void endList(); - - - virtual void beginListItem(); - - virtual void beginSuperscript(); - - virtual void endSuperscript(); - - virtual void beginSubscript(); - - virtual void endSubscript(); - - - virtual void beginTable(qreal, qreal, const QString &); - - virtual void beginTableRow(); - - - virtual void appendLiteralText(const QString &text); - - const QString escape(const QString &s); - - virtual QString& getResult(); - -private: - QList currentListItemStyles; - - QString m_text; - - Qt::Alignment currentAlignment; - -}; - -#endif - diff --git a/kpimtextedit/richtextbuilders/kabstractmarkupbuilder.h b/kpimtextedit/richtextbuilders/kabstractmarkupbuilder.h deleted file mode 100644 index 95d2c4f8c..000000000 --- a/kpimtextedit/richtextbuilders/kabstractmarkupbuilder.h +++ /dev/null @@ -1,318 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -// Any class for which you cannot create instances is an abstract class. - -#ifndef KABSTRACTMARKUPBUILDER_H -#define KABSTRACTMARKUPBUILDER_H - - -#include -#include -#include -#include - -/** -@brief The KAbstractMarkupBuilder class serves as a base class for creating marked up plain text output. - -The KAbstractMarkupBuilder is used by the MarkupDirector to create marked up output such as html or markdown. - -Subclasses can reimplement whichever methods they choose. None of the methods are pure virtual and all default to an empty function -to allow a clean fall-through. The exception is appendLiteralText, which appends its argument to the text being built. - -See PlainTextMarkupBuilder and HTMLBuilder for example implementations. - -@note For maintenance, if an extra tag is needed which is not provided by the virtual methods, the ExtraElement can be used. - -eg, - -@code - -builder->beginExtraElement(KAbstractMarkupBuilder::DivTag); -// ... -builder->endExtraElement(KAbstractMarkupBuilder::DivTag); - -@endcode - -@todo Move this to kdelibs when tested. - -@author Stephen Kelly -@since 4.2 -*/ -class KAbstractMarkupBuilder -{ -public: - - /** For future compatibility. - This enum can be used to insert extra tags not supported by the virtual methods. */ - enum ExtraElement { UserElement = 100 }; - - /** Destructor */ - virtual ~KAbstractMarkupBuilder() {} - - /** Begin a bold element in the markup */ - virtual void beginStrong() { } - - /** Close the bold element in the markup */ - virtual void endStrong() { } - - /** Begin an emphasised element in the markup */ - virtual void beginEmph() { } - - /** Close the emphasised element in the markup */ - virtual void endEmph() { } - - /** Begin an underlined element in the markup */ - virtual void beginUnderline() { } - - /** Close the underlined element in the markup */ - virtual void endUnderline() { } - - /** Begin a struck out element in the markup */ - virtual void beginStrikeout() { } - - /** Close the struck out element in the markup */ - virtual void endStrikeout() { } - - /** Begin a decorarated foreground element in the markup (A text color) */ - virtual void beginForeground(const QBrush &brush) { - Q_UNUSED(brush); - } - - /** Close the decorarated foreground element in the markup */ - virtual void endForeground() { } - - /** Begin a decorarated background element in the markup (A text background color) */ - virtual void beginBackground(const QBrush &brush) { - Q_UNUSED(brush); - } - - /** Close the decorarated background element in the markup */ - virtual void endBackground() { } - - /** Begin a url anchor element in the markup - @param href The href of the anchor. - @param name The name of the anchor. - */ - virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()) { - Q_UNUSED(href); - Q_UNUSED(name); - } - - /** Close the anchor element */ - virtual void endAnchor() { } - - /** Begin a new font familiy element in the markup - @param family The name of the font family to begin. - */ - virtual void beginFontFamily(const QString &family) { - Q_UNUSED(family); - } - /** End font family element */ - virtual void endFontFamily() { } - - /** Begin a new font point size element in the markup - @param int The point size to begin. - */ - virtual void beginFontPointSize(int size) { - Q_UNUSED(size); - } - /** End font point size element */ - virtual void endFontPointSize() { } - - /** Begin a new paragraph in the markup - @param a The alignment of the new paragraph. - @param top The top margin of the new paragraph. - @param bottom The bottom margin of the new paragraph. - @param left The left margin of the new paragraph. - @param right The right margin of the new paragraph. - */ - virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, qreal bottom = 0.0, qreal left = 0.0, qreal right = 0.0) { - Q_UNUSED(a); - Q_UNUSED(top); - Q_UNUSED(bottom); - Q_UNUSED(left); - Q_UNUSED(right); - } - - - /** Close the paragraph in the markup. */ - virtual void endParagraph() { } - /** Add a newline to the markup. */ - virtual void addNewline() { } - - /** Insert a horizontal rule into the markup. - @param width The width of the rule. Default is full width. - */ - virtual void insertHorizontalRule(int width = -1) { - Q_UNUSED(width); - } - - /** - Insert a new image element into the markup. - @param url The url of the image - @param width The width of the image - @param height The height of the image. - */ - virtual void insertImage(const QString &url, qreal width, qreal height) { - Q_UNUSED(url); - Q_UNUSED(width); - Q_UNUSED(height); - } - - /** - Begin a new list element in the markup. - A list element contains list items, and may contain other lists. - @param style The style of list to create. - */ - virtual void beginList(QTextListFormat::Style style) { - Q_UNUSED(style); - } - - /** - Close the list. - */ - virtual void endList() { } - - /** Begin a new list item in the markup */ - virtual void beginListItem() { } - - /** End the list item */ - virtual void endListItem() { } - - /** Begin a superscript element */ - virtual void beginSuperscript() { } - - /** End superscript element */ - virtual void endSuperscript() { } - - /** Begin a subscript element */ - virtual void beginSubscript() { } - - /** End subscript element */ - virtual void endSubscript() { } - - /** - Begin a table element. - - @param cellpadding The padding attribute for the table. - @param cellspacing The spacing attribute for the table. - @param width The width of the table. May be either an integer, or a percentage value. - */ - virtual void beginTable(qreal cellpadding, qreal cellspacing, const QString &width) { - Q_UNUSED(cellpadding); - Q_UNUSED(cellspacing); - Q_UNUSED(width); - } - - /** - Begins a new table row. - */ - virtual void beginTableRow() { } - - /** - Begin a new table header cell. - @param width The width of the cell. - @param colSpan The column span of the cell. - @param rowSpan The row span of the cell. - */ - virtual void beginTableHeaderCell(const QString &width, int colSpan, int rowSpan) { - Q_UNUSED(width); - Q_UNUSED(colSpan); - Q_UNUSED(rowSpan); - } - - /** - Begin a new table cell. - @param width The width of the cell. - @param colSpan The column span of the cell. - @param rowSpan The row span of the cell. - */ - virtual void beginTableCell(const QString &width, int colSpan, int rowSpan) { - Q_UNUSED(width); - Q_UNUSED(colSpan); - Q_UNUSED(rowSpan); - } - - /** End a table element */ - virtual void endTable() { } - - /** End a table row */ - virtual void endTableRow() { } - - /** End a table header cell */ - virtual void endTableHeaderCell() { } - - /** End a table cell */ - virtual void endTableCell() { } - - /** - Begin a level @p level header. - @param level An integer between 1 and 6 - */ - virtual void beginHeader(int level) { - Q_UNUSED(level); - } - - /** - End a level @p level header. - @param level An integer between 1 and 6 - */ - virtual void endHeader(int level) { - Q_UNUSED(level); - } - - - /** Begin an extra identified element. Override this to support more elements - in the future in a BC way. - - @param type The type of element to create - @param args Arguments for the element. - */ - virtual void beginExtraElement(int type, QVariantList args) { - Q_UNUSED(type); - Q_UNUSED(args); - } - - /** End extra tag. - - @param type The type of the tag to end. - */ - virtual void endExtraElement(int type) { - Q_UNUSED(type); - } - - /** - Append the plain text @p text to the markup. - - @param The text to append. - */ - virtual void appendLiteralText(const QString &text) = 0; - - /** Return the fully marked up result of the building process. This may contain metadata etc, such as a head element in html. - - @return The fully marked up text. - */ - virtual QString& getResult() = 0; - -}; - -#endif diff --git a/kpimtextedit/richtextbuilders/kmarkupdirector.cpp b/kpimtextedit/richtextbuilders/kmarkupdirector.cpp deleted file mode 100644 index 55ee7ba32..000000000 --- a/kpimtextedit/richtextbuilders/kmarkupdirector.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - - -#include "kmarkupdirector.h" -#include "kmarkupdirector_p.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kabstractmarkupbuilder.h" - -KMarkupDirector::KMarkupDirector(KAbstractMarkupBuilder* builder) : - d(new Private(this)) -{ - d->builder = builder; -} - -KMarkupDirector::~KMarkupDirector() -{ - delete d; -} - -void KMarkupDirector::processDocumentContents(QTextFrame::iterator start, QTextFrame::iterator end) -{ - for (QTextFrame::iterator it = start; ((!it.atEnd()) && (it != end)); ++it) { - QTextFrame *frame = it.currentFrame(); - if (frame) { - QTextTable *table = dynamic_cast(frame); - if (table) { - processTable(table); - } else { - processFrame(frame); - } - } else { - processBlock(it.currentBlock()); - } - } -} - -void KMarkupDirector::processFrame(QTextFrame* frame) -{ - processDocumentContents(frame->begin(), frame->end()); -} - -void KMarkupDirector::processBlock(const QTextBlock &block) -{ - if (block.isValid()) { - QTextList *list = block.textList(); - if (list) { - // An entire list is processed when first found. - // Just skip over if not the first item in a list. - if ((list->item(0) == block) && (!block.previous().textList())) { - processList(block); - } - } else { - processBlockContents(block); - } - } -} - -void KMarkupDirector::processTable(QTextTable *table) -{ - QTextTableFormat format = table->format(); - QVector colLengths = format.columnWidthConstraints(); - - QTextLength tableWidth = format.width(); - QString sWidth; - - if (tableWidth.type() == QTextLength::PercentageLength) { - sWidth = "%1%"; - sWidth = sWidth.arg(tableWidth.rawValue()); - } else if (tableWidth.type() == QTextLength::FixedLength) { - sWidth = "%1"; - sWidth = sWidth.arg(tableWidth.rawValue()); - } - - d->builder->beginTable(format.cellPadding(), format.cellSpacing(), sWidth); - - int headerRowCount = format.headerRowCount(); - - QList alreadyProcessedCells; - - for (int row = 0; row < table->rows(); ++row) { - // Put a thead element around here somewhere? - // if (row < headerRowCount) - // { - // d->builder->beginTableHeader(); - // } - - d->builder->beginTableRow(); - - // Header attribute should really be on cells, not determined by number of rows. - //http://www.webdesignfromscratch.com/html-tables.cfm - - - for (int column = 0; column < table->columns(); ++column) { - - QTextTableCell tableCell = table->cellAt(row, column); - - int columnSpan = tableCell.columnSpan(); - int rowSpan = tableCell.rowSpan(); - if ((rowSpan > 1) || (columnSpan > 1)) { - if (alreadyProcessedCells.contains(tableCell)) { - // Already processed this cell. Move on. - continue; - } else { - alreadyProcessedCells.append(tableCell); - } - } - - QTextLength cellWidth = colLengths.at(column); - - QString sCellWidth; - - if (cellWidth.type() == QTextLength::PercentageLength) { - sCellWidth = "%1%"; - sCellWidth = sCellWidth.arg(cellWidth.rawValue()); - } else if (cellWidth.type() == QTextLength::FixedLength) { - sCellWidth = "%1"; - sCellWidth = sCellWidth.arg(cellWidth.rawValue()); - } - - // TODO: Use THEAD instead - if (row < headerRowCount) { - d->builder->beginTableHeaderCell(sCellWidth, columnSpan, rowSpan); - } else { - d->builder->beginTableCell(sCellWidth, columnSpan, rowSpan); - } - - processTableCell(tableCell); - - if (row < headerRowCount) { - d->builder->endTableHeaderCell(); - } else { - d->builder->endTableCell(); - } - } - d->builder->endTableRow(); - } - d->builder->endTable(); -} - -void KMarkupDirector::processTableCell(const QTextTableCell &cell) -{ - processDocumentContents(cell.begin(), cell.end()); -} - -void KMarkupDirector::processList(const QTextBlock &ablock) -{ - QTextBlock block(ablock); - - QTextList *list = block.textList(); - if (!list) { - return; - } - - QList lists; - - while (block.isValid() && block.textList()) { - if (list->item(0) == block) { - // Item zero in a list is the first block in the list of blocks that make up a list. - QTextListFormat::Style style = list->format().style(); - d->builder->beginList(style); - - lists.append(list); - } - - d->builder->beginListItem(); - processBlockContents(block); - d->builder->endListItem(); - - block = block.next(); - - if (block.isValid()) { - QTextList *newList = block.textList(); - - if (!newList) { - while (!lists.isEmpty()) { - lists.removeLast(); - d->builder->endList(); - } - } else if (newList == list) { - //Next block is on the same list; Handled on next iteration. - continue; - } else if (newList != list) { - if (newList->item(0) == block) { - list = newList; - continue; - } else { - while (!lists.isEmpty()) { - if (block.textList() != lists.last()) { - lists.removeLast(); - d->builder->endList(); - } else { - break; - } - } - continue; - } - } - } else { - // Next block is not valid. Maybe at EOF. Close all open lists. - // TODO: Figure out how to handle lists in adjacent table cells. - while (!lists.isEmpty()) { - lists.removeLast(); - d->builder->endList(); - } - } - } -} - -void KMarkupDirector::processBlockContents(const QTextBlock &block) -{ - QTextBlockFormat blockFormat = block.blockFormat(); - Qt::Alignment blockAlignment = blockFormat.alignment(); - - // TODO: decide when to use

etc. - - if (blockFormat.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)) { - d->builder->insertHorizontalRule(); - return; - } - - QTextBlock::iterator it; - it = block.begin(); - - // The beginning is the end. This is an empty block. Insert a newline and move on. - // This is what gets generated by a QTextEdit... - if (it.atEnd()) { -// kDebug() << "The beginning is the end"; - d->builder->addNewline(); - return; - } - - QTextFragment fragment = it.fragment(); - - // .. but if a sequence such as '

' is imported into a document with setHtml, Separator_Line - // characters are inserted here within one block. See testNewlines and testNewlinesThroughQTextEdit. - if (fragment.isValid()) { - QTextCharFormat fragmentFormat = fragment.charFormat(); - - if (!fragmentFormat.isImageFormat() && fragment.text().at(0).category() == QChar::Separator_Line) { - - // Consecutive newlines in a qtextdocument are in a single fragment if inserted with setHtml. - foreach(QChar c, fragment.text()) { -// kDebug() << c; - if (c.category() == QChar::Separator_Line) { - d->builder->addNewline(); - } - } - return; - } - } - - // Don't have p tags inside li tags. - if (!block.textList()) - { - // Don't instruct builders to use margins. The rich text widget doesn't have an action for them yet, - // So users can't edit them. See bug http://bugs.kde.org/show_bug.cgi?id=160600 - d->builder->beginParagraph(blockAlignment //, - // blockFormat.topMargin(), - // blockFormat.bottomMargin(), - // blockFormat.leftMargin(), - // blockFormat.rightMargin() - ); - } - while (!it.atEnd()) { - fragment = it.fragment(); - if (fragment.isValid()) { - QTextCharFormat fragmentFormat = fragment.charFormat(); - - if (fragmentFormat.isImageFormat()) { - // TODO: Close any open format elements? - QTextImageFormat imageFormat = fragmentFormat.toImageFormat(); - d->builder->insertImage(imageFormat.name(), imageFormat.width(), imageFormat.height()); - ++it; - continue; - } else { - // The order of closing and opening tags can determine whether generated html is valid or not. - // When processing a document with formatting which appears as 'Some formatted text', - // the correct generated output will contain 'Some formatted text'. - // However, processing text which appears as 'Some formatted text' might be incorrectly rendered - // as 'Some formatted text' if tags which start at the same fragment are - // opened out of order. Here, tags are not nested properly, and the html would - // not be valid or render correctly by unforgiving parsers (like QTextEdit). - // One solution is to make the order of opening tags dynamic. In the above case, the em tag would - // be opened before the strong tag 'Some formatted text'. That would - // require knowledge of which tag is going to close first. That might be possible by examining - // the 'next' QTextFragment while processing one. - // - // The other option is to do pessimistic closing of tags. - // In the above case, this means that if a fragment has two or more formats applied (bold and italic here), - // and one of them is closed, then all tags should be closed first. They will of course be reopened - // if necessary while processing the next fragment. - // The above case would be rendered as 'Some formatted text'. - // - // The first option is taken here, as the redundant opening and closing tags in the second option - // didn't appeal. - // See testDoubleStartDifferentFinish, testDoubleStartDifferentFinishReverseOrder - - d->processOpeningElements(it); - - // If a sequence such as '

' is imported into a document with setHtml, LineSeparator - // characters are inserted. Here I make sure to put them back. - QStringList sl = fragment.text().split(QChar( QChar::LineSeparator ) ); - QStringListIterator i(sl); - bool paraClosed = false; - while (i.hasNext()) - { - d->builder->appendLiteralText(i.next()); - if (i.hasNext()) - { - if (i.peekNext().isEmpty()) - { - if (!paraClosed) - { - d->builder->endParagraph(); - paraClosed = true; - } - d->builder->addNewline(); - } else if (paraClosed) { - d->builder->beginParagraph(blockAlignment); - paraClosed = false; - } - } - } - - ++it; - d->processClosingElements(it); - } - } - } - - // Don't have p tags inside li tags. - if (!block.textList()) - { - d->builder->endParagraph(); - } - -} - -void KMarkupDirector::constructContent(QTextDocument* doc) -{ - QTextFrame *rootFrame = doc->rootFrame(); - processFrame(rootFrame); -} diff --git a/kpimtextedit/richtextbuilders/kmarkupdirector.h b/kpimtextedit/richtextbuilders/kmarkupdirector.h deleted file mode 100644 index 1bdca9754..000000000 --- a/kpimtextedit/richtextbuilders/kmarkupdirector.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - - -#ifndef KMARKUPDIRECTOR_H -#define KMARKUPDIRECTOR_H - - -#include "kabstractmarkupbuilder.h" -#include -class QTextFrame; -class QTextTable; -class QTextTableCell; -class QTextList; -class QTextCharFormat; - -/** -@brief The Markupdirector class controls and instructs a builder object to create markup output. - -The KMarkupDirector is used with a subclass of AbstractMarkupBuilder to create a marked up document output. - -Usage can be quite simple. - -@code - - QTextDocument *doc = editor->document(); // editor is a QTextEdit - - AbstractMarkupBuilder *builder = new HTMLBuilder(); - KMarkupDirector *md = new MarkupDirector(builder); - md->constructContent(doc); - browser.setHtml(builder->getResult()); // browser is a QTextBrowser. - -@endcode - -Or with a different builder: - -@code - AbstractMarkupBuilder *builder = new PlainTextMarkupBuilder(); - KMarkupDirector *md = new MarkupDirector(builder); - md->constructContent(doc); - browser.setPlainText(builder->getResult()); -@endcode - -@todo Move this to kdelibs when tested and prooven. - -@author Stephen Kelly -@since 4.2 - -*/ -class KMarkupDirector -{ -public: - /** - Construct a new KMarkupDirector - */ - KMarkupDirector(KAbstractMarkupBuilder* builder); - - /** Destructor */ - virtual ~KMarkupDirector(); - - /** - Constructs the output by directing the builder to create the markup. - */ - virtual void constructContent(QTextDocument* doc); - -protected: - - /** - Processes the frame by iterating over its child frames and blocks and processing them as needed. - */ - void processFrame(QTextFrame *frame); - - /** - Processes the table by iterating over its rows and columns, processing their contents. - */ - void processTable(QTextTable *table); - - /** - Processes the table cell by iterating over its contents. May contain another table, nested list etc. - */ - void processTableCell(const QTextTableCell &cell); - - /** - Processes a list by iterating over it. Nested lists are processed by a recursive call. - @param block The first block in a list. - */ - void processList(const QTextBlock &block); - - /** - Processes the contents of a QTextBlock. The block is traversed and each QTextFragment is processed individually. - - A QTextFragment is a fragment of continuous text with continuous formatting. - - Eg, a block of text represented by - - @code - Some long formatted paragraph of several pieces of decorated text . - @endcode - - would contain the fragments - - @li Some long - @li formatted paragraph - @li of several pieces - @li of decorated - @li text - - @param block The block to process. - */ - void processBlockContents(const QTextBlock &block); - - /** - Processes the document between the iterators @p start and @p end inclusive. - */ - void processDocumentContents(QTextFrame::iterator start, QTextFrame::iterator end); - - /** - Process a block. - - Note: If block is the first item in a list, the entire (maybe nested) list will be processed. - If block is part of a nested list, but is not the first item, it is ignored. - @param block The block to process. - */ - - void processBlock(const QTextBlock &block); - - /** - Processes a QTextFragment. - - @param fragment The fragment to process. - */ - void processFragment(const QTextFragment &fragment); - -private: - class Private; - friend class Private; - Private *const d; -}; - -#endif diff --git a/kpimtextedit/richtextbuilders/kmarkupdirector_p.cpp b/kpimtextedit/richtextbuilders/kmarkupdirector_p.cpp deleted file mode 100644 index cfb2af4f7..000000000 --- a/kpimtextedit/richtextbuilders/kmarkupdirector_p.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include - -#include "kmarkupdirector_p.h" - -void KMarkupDirector::Private::processClosingElements(QTextBlock::iterator it) -{ - // The order of closing elements is determined by the order they were opened in. - // The order of opened elements is in the openElements member list. - // see testDifferentStartDoubleFinish and testDifferentStartDoubleFinishReverseOrder - - QSet elementsToClose = getElementsToClose(it); - - int previousSize; - int remainingSize = elementsToClose.size(); - while (!elementsToClose.isEmpty()) { - if (!openElements.isEmpty()) { - int tag = openElements.last(); - if (elementsToClose.contains(tag)) { - switch (tag) { - case Strong: - builder->endStrong(); - break; - case Emph: - builder->endEmph(); - break; - case Underline: - builder->endUnderline(); - break; - case StrikeOut: - builder->endStrikeout(); - break; - case SpanFontPointSize: - builder->endFontPointSize(); - break; - case SpanFontFamily: - builder->endFontFamily(); - break; - case SpanBackground: - builder->endBackground(); - break; - case SpanForeground: - builder->endForeground(); - break; - case Anchor: - builder->endAnchor(); - break; - case SubScript: - builder->endSubscript(); - break; - case SuperScript: - builder->endSuperscript(); - break; - - default: - break; - } - openElements.removeLast(); - elementsToClose.remove(tag); - } - previousSize = remainingSize; - remainingSize = elementsToClose.size(); - - if (previousSize == remainingSize) { - // Iterated once through without closing any tags. - // This means that there's overlap in the tags, such as - // 'text with some formatting tags' - // See testOverlap. - // The top element in openElements must be a blocker, so close it on next iteration. - elementsToClose.insert(openElements.last()); - } - } - } -} - -QSet< int > KMarkupDirector::Private::getElementsToClose(QTextBlock::iterator it) -{ - QSet closedElements; - - if (!it.atEnd()) { - - QTextFragment fragment = it.fragment(); - if (fragment.isValid()) { - QTextCharFormat fragmentFormat = fragment.charFormat(); - - int fontWeight = fragmentFormat.fontWeight(); - bool fontItalic = fragmentFormat.fontItalic(); - bool fontUnderline = fragmentFormat.fontUnderline(); - bool fontStrikeout = fragmentFormat.fontStrikeOut(); - - QBrush fontForeground = fragmentFormat.foreground(); - QBrush fontBackground = fragmentFormat.background(); - - QString fontFamily = fragmentFormat.fontFamily(); - int fontPointSize = fragmentFormat.font().pointSize(); - QString anchorHref = fragmentFormat.anchorHref(); - - QTextCharFormat::VerticalAlignment vAlign = fragmentFormat.verticalAlignment(); - bool superscript = (vAlign == QTextCharFormat::AlignSuperScript); - bool subscript = (vAlign == QTextCharFormat::AlignSubScript); - - - if (!fontStrikeout && - (openElements.contains(StrikeOut) - || elementsToOpen.contains(StrikeOut))) { - closedElements.insert(StrikeOut); - } - - if (!fontUnderline && - (openElements.contains(Underline) - || elementsToOpen.contains(Underline)) - && !(openElements.contains(Anchor) - || elementsToOpen.contains(Anchor)) - ) { - closedElements.insert(Underline); - } - - if (!fontItalic && - (openElements.contains(Emph) - || elementsToOpen.contains(Emph))) { - closedElements.insert(Emph); - } - - if (fontWeight != QFont::Bold && - (openElements.contains(Strong) - || elementsToOpen.contains(Strong))) { - closedElements.insert(Strong); - } - - if ((openElements.contains(SpanFontPointSize) - || elementsToOpen.contains(SpanFontPointSize)) - && (openFontPointSize != fontPointSize) - ) { - closedElements.insert(SpanFontPointSize); - } - - if ((openElements.contains(SpanFontFamily) - || elementsToOpen.contains(SpanFontFamily)) - && (openFontFamily != fontFamily) - ) { - closedElements.insert(SpanFontFamily); - } - - if ((openElements.contains(SpanBackground) && (openBackground != fontBackground)) - || (elementsToOpen.contains(SpanBackground) && (backgroundToOpen != fontBackground))) { - closedElements.insert(SpanBackground); - } - - if ((openElements.contains(SpanForeground) && (openForeground != fontForeground)) - || (elementsToOpen.contains(SpanForeground) && (foregroundToOpen != fontForeground))) { - closedElements.insert(SpanForeground); - } - - if ((openElements.contains(Anchor) && (openAnchorHref != anchorHref)) - || (elementsToOpen.contains(Anchor) && (anchorHrefToOpen != anchorHref))) { - closedElements.insert(Anchor); - } - - - if (!subscript && - (openElements.contains(SubScript) - || elementsToOpen.contains(SubScript))) { - closedElements.insert(SubScript); - } - - if (!superscript && - (openElements.contains(SuperScript) - || elementsToOpen.contains(SuperScript))) { - closedElements.insert(SuperScript); - } - - } - } else { - // End of block?. Close all open tags. - QSet< int > elementsToClose = openElements.toSet(); - closedElements = elementsToClose.unite(elementsToOpen); - } - return closedElements; -} - - -QList< int > KMarkupDirector::Private::sortOpeningOrder(QSet< int > openingOrder, QTextBlock::iterator it) -{ - QList< int > sortedOpenedElements; - - // This is an insertion sort in a way. elements in openingOrder are assumed to be out of order. - // The rest of the block is traversed until there are no more elements to sort, or the end is reached. - while (openingOrder.size() != 0) { - if (!it.atEnd()) { - it++; - - if (it.fragment().isValid()) { - // Because I've iterated, this returns the elements that will - // be closed by the next fragment. - QSet elementsToClose = getElementsToClose(it); - - // The exact order these are opened in is irrelevant, as all will be closed on the same block. - // See testDoubleFormat. - foreach(int tag, elementsToClose) { - if (openingOrder.remove(tag)) { - sortedOpenedElements.prepend(tag); - } - } - } - } else { - // End of block. Need to close all open elements. - // Order irrelevant in this case. - foreach(int tag, openingOrder) { - sortedOpenedElements.prepend(tag); - } - break; - } - } - return sortedOpenedElements; -} - -QList< int > KMarkupDirector::Private::getElementsToOpen(QTextBlock::iterator it) -{ - QTextFragment fragment = it.fragment(); - if (!fragment.isValid()) { - return QList< int >(); - } - QTextCharFormat fragmentFormat = fragment.charFormat(); - - int fontWeight = fragmentFormat.fontWeight(); - bool fontItalic = fragmentFormat.fontItalic(); - bool fontUnderline = fragmentFormat.fontUnderline(); - bool fontStrikeout = fragmentFormat.fontStrikeOut(); - - QBrush fontForeground = fragmentFormat.foreground(); - QBrush fontBackground = fragmentFormat.background(); - - QString fontFamily = fragmentFormat.fontFamily(); - int fontPointSize = fragmentFormat.font().pointSize(); - QString anchorHref = fragmentFormat.anchorHref(); - - QTextCharFormat::VerticalAlignment vAlign = fragmentFormat.verticalAlignment(); - bool superscript = (vAlign == QTextCharFormat::AlignSuperScript); - bool subscript = (vAlign == QTextCharFormat::AlignSubScript); - - if (superscript && !(openElements.contains(SuperScript))) { - elementsToOpen.insert(SuperScript); - } - - if (subscript && !(openElements.contains(SubScript))) { - elementsToOpen.insert(SubScript); - } - - if (!anchorHref.isEmpty() - && !(openElements.contains(Anchor)) - && (openAnchorHref != anchorHref) - ) { - elementsToOpen.insert(Anchor); - anchorHrefToOpen = anchorHref; - } - - if (fontForeground != Qt::NoBrush - && !(openElements.contains(SpanForeground)) // Can only open one foreground element at a time. - && (fontForeground != openForeground) - && !((openElements.contains(Anchor) // If inside an anchor, only open a foreground span tag if - || elementsToOpen.contains(Anchor)) // it is not blue. Qt sort of enforces links being blue - && (fontForeground == Qt::blue)) // and underlined. See qt bug 203510. - ) { - elementsToOpen.insert(SpanForeground); - foregroundToOpen = fontForeground; - } - - if (fontBackground != Qt::NoBrush - && !(openElements.contains(SpanBackground)) - && (fontBackground != openBackground) - ) { - elementsToOpen.insert(SpanBackground); - backgroundToOpen = fontBackground; - } - - - if (!fontFamily.isEmpty() - && !(openElements.contains(SpanFontFamily)) - && (fontFamily != openFontFamily) - ) { - elementsToOpen.insert(SpanFontFamily); - fontFamilyToOpen = fontFamily; - } - - if ((QTextCharFormat().font().pointSize() != fontPointSize) // Different from the default. - && !(openElements.contains(SpanFontPointSize)) - && (fontPointSize != openFontPointSize) - ) { - elementsToOpen.insert(SpanFontPointSize); - fontPointSizeToOpen = fontPointSize; - } - -// Only open a new bold tag if one is not already open. -// eg, some mixed format should be as is, rather than -// some mixed format - - if (fontWeight == QFont::Bold && !(openElements.contains(Strong))) { - elementsToOpen.insert(Strong); - } - - if (fontItalic && !(openElements.contains(Emph))) { - elementsToOpen.insert(Emph); - } - - if (fontUnderline - && !(openElements.contains(Underline)) - && !(openElements.contains(Anchor) - || elementsToOpen.contains(Anchor)) // Can't change the underline state of a link. - ) { - elementsToOpen.insert(Underline); - } - - if (fontStrikeout && !(openElements.contains(StrikeOut))) { - elementsToOpen.insert(StrikeOut); - } - - if (elementsToOpen.size() <= 1) { - return elementsToOpen.toList(); - } - return sortOpeningOrder(elementsToOpen, QTextBlock::iterator(it)); - -} - -void KMarkupDirector::Private::processOpeningElements(QTextBlock::iterator it) -{ - QTextFragment fragment = it.fragment(); - - if (fragment.isValid()) { - QTextCharFormat fragmentFormat = fragment.charFormat(); - QList elementsToOpenList = getElementsToOpen(it); - - foreach(int tag, elementsToOpenList) { - switch (tag) { - case Strong: - builder->beginStrong(); - break; - case Emph: - builder->beginEmph(); - break; - case Underline: - builder->beginUnderline(); - break; - case StrikeOut: - builder->beginStrikeout(); - break; - case SpanFontPointSize: - builder->beginFontPointSize(fragmentFormat.font().pointSize()); - openFontPointSize = fragmentFormat.font().pointSize(); - break; - case SpanFontFamily: - builder->beginFontFamily(fragmentFormat.fontFamily()); - openFontFamily = fragmentFormat.fontFamily(); - break; - case SpanBackground: - builder->beginBackground(fragmentFormat.background()); - openBackground = fragmentFormat.background(); - break; - case SpanForeground: - builder->beginForeground(fragmentFormat.foreground()); - openForeground = fragmentFormat.foreground(); - break; - case Anchor: { - // TODO: Multiple anchor names here. - QStringList anchorNames = fragmentFormat.anchorNames(); - if (!anchorNames.isEmpty()) { - while (!anchorNames.isEmpty()) { - QString n = anchorNames.last(); - anchorNames.removeLast(); - if (anchorNames.isEmpty()) { - // Doesn't matter if anchorHref is empty. - builder->beginAnchor(fragmentFormat.anchorHref(), n); - break; - } else { - // Empty tags allow multipe names for the same section. - builder->beginAnchor(QString(), n); - builder->endAnchor(); - } - } - } else { - builder->beginAnchor(fragmentFormat.anchorHref()); - } - openAnchorHref = fragmentFormat.anchorHref(); - break; - } - case SuperScript: - builder->beginSuperscript(); - break; - case SubScript: - builder->beginSubscript(); - break; - default: - break; - } - openElements.append(tag); - elementsToOpen.remove(tag); - } - } -} diff --git a/kpimtextedit/richtextbuilders/kmarkupdirector_p.h b/kpimtextedit/richtextbuilders/kmarkupdirector_p.h deleted file mode 100644 index 659b82b7e..000000000 --- a/kpimtextedit/richtextbuilders/kmarkupdirector_p.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef KMARKUPDIRECTOR_P_H -#define KMARKUPDIRECTOR_P_H - -#include "kmarkupdirector.h" - -#include - -//@cond PRIVATE - -/** - * @internal - * Maintainability class for KMarkupDirector - */ -class KMarkupDirector::Private -{ -public: - Private(KMarkupDirector *md) - : q(md) { - } - - void processClosingElements(QTextBlock::iterator it); - void processOpeningElements(QTextBlock::iterator it); - QSet< int > getElementsToClose(QTextBlock::iterator it); - QList< int > getElementsToOpen(QTextBlock::iterator it); - QList< int > sortOpeningOrder(QSet< int > openingOrder, QTextBlock::iterator it); - - KMarkupDirector *q; - KAbstractMarkupBuilder *builder; - - enum OpenElementValues { - None = 0x0, - SuperScript = 0x01, - SubScript = 0x02, - Anchor = 0x04, - SpanForeground = 0x08, - SpanBackground = 0x10, - SpanFontFamily = 0x20, - SpanFontPointSize = 0x40, - Strong = 0x80, - Emph = 0x100, - Underline = 0x200, - StrikeOut = 0x400 - }; -// Q_DECLARE_FLAGS(OpenElements, OpenElementValues) - - QString openAnchorHref; - QString anchorHrefToOpen; - QString openAnchorName; - - QBrush openForeground; - QBrush foregroundToOpen; - QBrush openBackground; - QBrush backgroundToOpen; - int openFontPointSize; - int fontPointSizeToOpen; - QString openFontFamily; - QString fontFamilyToOpen; - - // An ordered list containing the order elements were opened in. - QList< int > openElements; - - // Elements that have yet to be opened. Used while determine the order to open them. - QSet< int > elementsToOpen; - -}; -// Q_DECLARE_OPERATORS_FOR_FLAGS(KMarkupDirector::Private::OpenElements) - -#endif -//@endcond diff --git a/kpimtextedit/richtextbuilders/kplaintextmarkupbuilder.cpp b/kpimtextedit/richtextbuilders/kplaintextmarkupbuilder.cpp deleted file mode 100644 index a23a6572f..000000000 --- a/kpimtextedit/richtextbuilders/kplaintextmarkupbuilder.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "kplaintextmarkupbuilder.h" - -#include - -class KPlainTextMarkupBuilderPrivate -{ -public: - KPlainTextMarkupBuilderPrivate(KPlainTextMarkupBuilder *b) : q_ptr(b) { - - } - - /** - Get a letter string to represent a number. - - The numbers 1-26 are represented by a-z, and 27-52 by aa-az, 53-79 by ba-bz etc. - - @param The number to convert - @return The letter string representation of the number. - */ - QString getLetterString(int itemNumber); - - /** - Gets a block of references in the body of the text. - This is an ordered list of links and images in the text. - */ - QString getReferences(); - - QStringList m_urls; - QList currentListItemStyles; - QList currentListItemNumbers; - - QString activeLink; - - QString m_text; - - KPlainTextMarkupBuilder *q_ptr; - - Q_DECLARE_PUBLIC(KPlainTextMarkupBuilder) - -}; - -QString KPlainTextMarkupBuilderPrivate::getLetterString(int itemNumber) -{ - QString letterString; - while (true) { - // Create the letter string by prepending one char at a time. - // The itemNumber is converted to a number in the base 36 (number of letters in the - // alphabet plus 10) after being increased by 10 (to pass out the digits 0 to 9). - letterString.prepend(QString("%1").arg((itemNumber % LETTERSINALPHABET) + DIGITSOFFSET, - 0, // no padding while building this string. - LETTERSINALPHABET + DIGITSOFFSET)); - if ((itemNumber >= LETTERSINALPHABET)) { - itemNumber = itemNumber / LETTERSINALPHABET; - itemNumber--; - } else { - break; - } - } - return letterString; -} - -QString KPlainTextMarkupBuilderPrivate::getReferences() -{ - QString refs; - if (!m_urls.isEmpty()) { - refs.append(i18nc("Beginning of the references section, which lists all external references", - "\n---- References ----\n")); - - int index = 1; - while (!m_urls.isEmpty()) { - refs.append(QString("[%1] %2\n").arg(index++).arg(m_urls.takeFirst())); - } - } - return refs; -} - -KPlainTextMarkupBuilder::KPlainTextMarkupBuilder() : d_ptr(new KPlainTextMarkupBuilderPrivate(this)) -{ - Q_D(KPlainTextMarkupBuilder); - d->m_urls = QStringList(); -} - -void KPlainTextMarkupBuilder::beginStrong() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("*"); -} -void KPlainTextMarkupBuilder::endStrong() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("*"); -} -void KPlainTextMarkupBuilder::beginEmph() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("/"); -} -void KPlainTextMarkupBuilder::endEmph() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("/"); -} -void KPlainTextMarkupBuilder::beginUnderline() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("_"); -} -void KPlainTextMarkupBuilder::endUnderline() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("_"); -} -void KPlainTextMarkupBuilder::beginStrikeout() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("-"); -} -void KPlainTextMarkupBuilder::endStrikeout() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("-"); -} - -void KPlainTextMarkupBuilder::beginAnchor(const QString &href, const QString &name) -{ - Q_D(KPlainTextMarkupBuilder); - Q_UNUSED(name); - if (!d->m_urls.contains(href)) { - - d->m_urls.append(href); - } - d->activeLink = href; -} - -void KPlainTextMarkupBuilder::endAnchor() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append(QString("[%1]").arg(d->m_urls.indexOf(d->activeLink) + 1)); -} - -void KPlainTextMarkupBuilder::endParagraph() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("\n"); -} - -void KPlainTextMarkupBuilder::addNewline() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("\n"); -} - -void KPlainTextMarkupBuilder::insertHorizontalRule(int width) -{ - Q_UNUSED(width) - Q_D(KPlainTextMarkupBuilder); - - d->m_text.append("--------------------\n"); -} - -void KPlainTextMarkupBuilder::insertImage(const QString &src, qreal width, qreal height) -{ - Q_D(KPlainTextMarkupBuilder); - Q_UNUSED(width) - Q_UNUSED(height) - - if (!d->m_urls.contains(src)) { - d->m_urls.append(src); - } - d->m_text.append(QString("[%1]").arg(d->m_urls.indexOf(src) + 1)); -} - - -void KPlainTextMarkupBuilder::beginList(QTextListFormat::Style style) -{ - Q_D(KPlainTextMarkupBuilder); - d->currentListItemStyles.append(style); - d->currentListItemNumbers.append(0); -} - -void KPlainTextMarkupBuilder::endList() -{ - Q_D(KPlainTextMarkupBuilder); - if (!d->currentListItemNumbers.isEmpty()) { - d->currentListItemStyles.removeLast(); - d->currentListItemNumbers.removeLast(); - } -} -void KPlainTextMarkupBuilder::beginListItem() -{ - Q_D(KPlainTextMarkupBuilder); - for (int i = 0; i < d->currentListItemNumbers.size(); i++) { - d->m_text.append(" "); - } - - int itemNumber = d->currentListItemNumbers.last(); - QString letterString; - - switch (d->currentListItemStyles.last()) { - case QTextListFormat::ListDisc: - d->m_text.append(" * "); - break; - case QTextListFormat::ListCircle: - d->m_text.append(" o "); - break; - case QTextListFormat::ListSquare: - d->m_text.append(" - "); - break; - case QTextListFormat::ListDecimal: - d->m_text.append(QString(" %1. ").arg(itemNumber + 1)); - break; - case QTextListFormat::ListLowerAlpha: - d->m_text.append(QString(" %1. ").arg(d->getLetterString(itemNumber))); - break; - case QTextListFormat::ListUpperAlpha: - d->m_text.append(QString(" %1. ").arg(d->getLetterString(itemNumber).toUpper())); - break; - default: - break; - } -} - -void KPlainTextMarkupBuilder::endListItem() -{ - Q_D(KPlainTextMarkupBuilder); - d->currentListItemNumbers.last() = d->currentListItemNumbers.last() + 1; -} - - -void KPlainTextMarkupBuilder::beginSuperscript() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("^{"); -} - -void KPlainTextMarkupBuilder::endSuperscript() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("}"); -} - -void KPlainTextMarkupBuilder::beginSubscript() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("_{"); -} - -void KPlainTextMarkupBuilder::endSubscript() -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append("}"); -} - -void KPlainTextMarkupBuilder::appendLiteralText(const QString &text) -{ - Q_D(KPlainTextMarkupBuilder); - d->m_text.append(text); -} - -QString& KPlainTextMarkupBuilder::getResult() -{ - Q_D(KPlainTextMarkupBuilder); - QString &ret = d->m_text; - ret.append(d->getReferences()); - return ret; -} - diff --git a/kpimtextedit/richtextbuilders/kplaintextmarkupbuilder.h b/kpimtextedit/richtextbuilders/kplaintextmarkupbuilder.h deleted file mode 100644 index 59629932f..000000000 --- a/kpimtextedit/richtextbuilders/kplaintextmarkupbuilder.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef KPLAINTEXTMARKUPBUILDER_H -#define KPLAINTEXTMARKUPBUILDER_H - -#define LETTERSINALPHABET 26 -#define DIGITSOFFSET 10 - -#include - -#include "kabstractmarkupbuilder.h" - -class KPlainTextMarkupBuilderPrivate; - -/** -@brief The KPlainTextMarkupBuilder creates a simple marked up plain text document. - -This class creates a simple plain text markup. - -Text that may be represented as - -@code - A paragraph with bold text, italic text, and underlined text. -@endcode - -would be output as - -@code - A paragraph with *bold* text /italic/ text, and _underlined_ text. -@endcode - -The markup is intended to be simple, plain and easily human readable. No markup is created for different font-familiy, font-size, foreground or background colors. - -Lists are marked up by preceding the list element with '*' for disc, 'o' for circle, 'X' for square, or a letter or number. Lists are also indented if nested. -eg: - -@code - A. One - B. Two - o Three - o Four - \* Five - \* Six - C. Seven -@endcode - -External references such as external urls and images are represented in the body text as a reference, and references are maintained at the bottom of the output. - -Eg, -@code - Here is a link to KDE and the KDEPIM project. -@endcode - -becomes: - -@code - Here is a link to KDE[1], and the KDEPIM project[2]. - - ---- References ---- - [1] http://www.kde.org - [2] http://pim.kde.org -@endcode - -@todo Move this to kdelibs when tested and in use. - -@author Stephen Kelly -@since 4.2 - -*/ -class KPlainTextMarkupBuilder : public KAbstractMarkupBuilder -{ -public: - /** Construct a new KPlainTextMarkupBuilder. */ - KPlainTextMarkupBuilder(); - - virtual void beginStrong(); - virtual void endStrong(); - virtual void beginEmph(); - virtual void endEmph(); - virtual void beginUnderline(); - virtual void endUnderline(); - virtual void beginStrikeout(); - virtual void endStrikeout(); - - virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()); - - virtual void endAnchor(); - - virtual void endParagraph(); - virtual void addNewline(); - - virtual void insertHorizontalRule(int width = -1); - - virtual void insertImage(const QString &src, qreal width, qreal height); - - - virtual void beginList(QTextListFormat::Style style); - - virtual void endList(); - - virtual void beginListItem(); - - virtual void endListItem(); - - - virtual void beginSuperscript(); - - virtual void endSuperscript(); - - virtual void beginSubscript(); - - virtual void endSubscript(); - - virtual void appendLiteralText(const QString &text); - - /** - Returns the finalised plain text markup, including references at the end. - */ - virtual QString& getResult(); - -private: - KPlainTextMarkupBuilderPrivate *d_ptr; - Q_DECLARE_PRIVATE(KPlainTextMarkupBuilder) - - -}; - -#endif diff --git a/kpimtextedit/richtextbuilders/krichtexteditor.cpp b/kpimtextedit/richtextbuilders/krichtexteditor.cpp deleted file mode 100644 index e726c21b5..000000000 --- a/kpimtextedit/richtextbuilders/krichtexteditor.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/** - * KDE Rich Text Editor - * - * Copyright 2008  Stephen Kelly - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301  USA - */ - -#include "krichtexteditor.h" - -#include "kabstractmarkupbuilder.h" -#include "kplaintextmarkupbuilder.h" -#include "ktexthtmlbuilder.h" -#include "bbcodebuilder.h" -#include "mediawikimarkupbuilder.h" - - -#include "kmarkupdirector.h" - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -KRichTextEditor::KRichTextEditor() : KXmlGuiWindow() -{ - setupActions(); - - textArea = new KRichTextWidget(this); - - - QPushButton *b = new QPushButton(i18n("Update!"), this); - connect(b, SIGNAL(pressed()), SLOT(updateDockedWidgets())); - - QVBoxLayout *l = new QVBoxLayout(); - QWidget *w = new QWidget(); - l->addWidget(textArea); - l->addWidget(b); - w->setLayout(l); - - setCentralWidget(w); - - textArea->createActions(actionCollection()); - setupGUI(); - - statusBar()->insertItem(QString(), 0, 1); - statusBar()->setItemAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); - - connect(textArea, SIGNAL(cursorPositionChanged()), - SLOT(cursorPositionChanged())); - - QDockWidget *dockText = new QDockWidget(QString("HTML"), this); - dockText->setObjectName("HTML"); - dockText->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - kte = new KTextEdit(dockText); - dockText->setWidget(kte); - addDockWidget(Qt::RightDockWidgetArea, dockText); - - QDockWidget *dockHtml = new QDockWidget(QString("Re-Rendered"), this); - dockHtml->setObjectName("Re-Rendered"); - dockHtml->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - krte = new KTextEdit(dockHtml); - krte->document()->setDefaultStyleSheet("p {margin-top:0px;margin-bottom:0px;}ul{margin-top:12px;margin-bottom:12px;} "); // ####################### - dockHtml->setWidget(krte); - addDockWidget(Qt::RightDockWidgetArea, dockHtml); - - QDockWidget *dockPlain = new QDockWidget(QString("Plain"), this); - dockPlain->setObjectName("Plain"); - dockPlain->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - kpte = new KTextEdit(dockPlain); - dockPlain->setWidget(kpte); - addDockWidget(Qt::RightDockWidgetArea, dockPlain); - - QDockWidget *dockBB = new QDockWidget(QString("BBCode"), this); - dockBB->setObjectName("BBCode"); - dockBB->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - kbbte = new KTextEdit(dockBB); - dockBB->setWidget(kbbte); - addDockWidget(Qt::RightDockWidgetArea, dockBB); - - QDockWidget *dockMW = new QDockWidget(QString("MediaWiki"), this); - dockMW->setObjectName("MediaWiki"); - dockMW->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - kmwte = new KTextEdit(dockMW); - dockMW->setWidget(kmwte); - addDockWidget(Qt::RightDockWidgetArea, dockMW); -} - -void KRichTextEditor::updateDockedWidgets() -{ - KTextHTMLBuilder *hb = new KTextHTMLBuilder(); - - KMarkupDirector *hmd = new KMarkupDirector(hb); - hmd->constructContent(textArea->document()); - - QString t = hb->getResult(); - - kDebug() << t; - - kte->setPlainText(t); - krte->setHtml(t); - - KPlainTextMarkupBuilder *pb = new KPlainTextMarkupBuilder(); - - KMarkupDirector *pmd = new KMarkupDirector(pb); - pmd->constructContent(textArea->document()); - - kpte->setPlainText(pb->getResult()); - - BBCodeBuilder *bbb = new BBCodeBuilder(); - - KMarkupDirector *bbmd = new KMarkupDirector(bbb); - bbmd->constructContent(textArea->document()); - - kbbte->setPlainText(bbb->getResult()); - - MediaWikiMarkupBuilder *mwb = new MediaWikiMarkupBuilder(); - - KMarkupDirector *mwmd = new KMarkupDirector(mwb); - mwmd->constructContent(textArea->document()); - - kmwte->setPlainText(mwb->getResult()); -} - -KRichTextEditor::~KRichTextEditor() -{ -} - -void KRichTextEditor::setupActions() -{ - KStandardAction::quit(kapp, SLOT(quit()), - actionCollection()); - - KStandardAction::open(this, SLOT(openFile()), - actionCollection()); - - KStandardAction::save(this, SLOT(saveFile()), - actionCollection()); - - KStandardAction::saveAs(this, SLOT(saveFileAs()), - actionCollection()); - - KStandardAction::openNew(this, SLOT(newFile()), - actionCollection()); -} - -void KRichTextEditor::cursorPositionChanged() -{ -// Show link target in status bar - if (textArea->textCursor().charFormat().isAnchor()) { - QString text = textArea->currentLinkText(); - QString url = textArea->currentLinkUrl(); - statusBar()->changeItem(text + " -> " + url, 0); - } else { - statusBar()->changeItem(QString(), 0); - } -} - -void KRichTextEditor::newFile() -{ -//maybeSave - fileName.clear(); - textArea->clear(); -} - -void KRichTextEditor::saveFileAs(const QString &outputFileName) -{ - KSaveFile file(outputFileName); - file.open(); - - QByteArray outputByteArray; - outputByteArray.append(textArea->toHtml().toUtf8()); - file.write(outputByteArray); - file.finalize(); - file.close(); - - fileName = outputFileName; -} - -void KRichTextEditor::saveFileAs() -{ - saveFileAs(KFileDialog::getSaveFileName()); -} - -void KRichTextEditor::saveFile() -{ - if (!fileName.isEmpty()) { - saveFileAs(fileName); - } else { - saveFileAs(); - } -} - -void KRichTextEditor::openFile() -{ - QString fileNameFromDialog = KFileDialog::getOpenFileName(); - if (fileNameFromDialog.isEmpty()) { - return; - } - - QString tmpFile; - if (KIO::NetAccess::download(fileNameFromDialog, tmpFile, - this)) { - QFile file(tmpFile); - file.open(QIODevice::ReadOnly); - textArea->setTextOrHtml(QTextStream(&file).readAll()); - fileName = fileNameFromDialog; - - KIO::NetAccess::removeTempFile(tmpFile); - } else { - KMessageBox::error(this, - KIO::NetAccess::lastErrorString()); - } - -} diff --git a/kpimtextedit/richtextbuilders/krichtexteditor.h b/kpimtextedit/richtextbuilders/krichtexteditor.h deleted file mode 100644 index f9dcc5b22..000000000 --- a/kpimtextedit/richtextbuilders/krichtexteditor.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * KDE Rich Text Editor - * - * Copyright 2008  Stephen Kelly - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301  USA - */ - -#ifndef KRICHTEXTEDITOR_H -#define KRICHTEXTEDITOR_H - -#include - -#include - -//@cond PRIVATE - -/** - * @internal - * Test window for testing KRichTextWidget - */ -class KRichTextEditor : public KXmlGuiWindow -{ - Q_OBJECT -public: - KRichTextEditor(); - ~KRichTextEditor(); - - void setupActions(); - -private slots: - void newFile(); - void openFile(); - void saveFile(); - void saveFileAs(); - void saveFileAs(const QString &outputFileName); - void cursorPositionChanged(); - void updateDockedWidgets(); - -private: - KRichTextWidget *textArea; - KTextEdit *kte; - KTextEdit *krte; - KTextEdit *kpte; - KTextEdit *kbbte; - KTextEdit *kmwte; - QString fileName; -}; - -//@endcond - -#endif diff --git a/kpimtextedit/richtextbuilders/krichtexteditorui.rc b/kpimtextedit/richtextbuilders/krichtexteditorui.rc deleted file mode 100644 index 0fe4036b1..000000000 --- a/kpimtextedit/richtextbuilders/krichtexteditorui.rc +++ /dev/null @@ -1,59 +0,0 @@ - - - - - F&ormat - - - - - - - - &Alignment - - - - - - - - - - - - - - - - -Text Toolbar - - - - - - - - - - - -Format Toolbar - - - - - - - - - - - - - - - - - diff --git a/kpimtextedit/richtextbuilders/ktexthtmlbuilder.cpp b/kpimtextedit/richtextbuilders/ktexthtmlbuilder.cpp deleted file mode 100644 index 54be3c3b3..000000000 --- a/kpimtextedit/richtextbuilders/ktexthtmlbuilder.cpp +++ /dev/null @@ -1,442 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "ktexthtmlbuilder.h" - -#include -#include - -class KTextHTMLBuilderPrivate -{ -public: - KTextHTMLBuilderPrivate(KTextHTMLBuilder *b) : q_ptr(b) { - - } - - QList currentListItemStyles; - QString m_text; - - KTextHTMLBuilder *q_ptr; - - Q_DECLARE_PUBLIC(KTextHTMLBuilder) - -}; - -KTextHTMLBuilder::KTextHTMLBuilder() : d_ptr(new KTextHTMLBuilderPrivate(this)) -{ - -} - -KTextHTMLBuilder::~KTextHTMLBuilder() -{ - -} - -void KTextHTMLBuilder::beginStrong() -{ - Q_D(KTextHTMLBuilder);; - d->m_text.append(""); -} - -void KTextHTMLBuilder::endStrong() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginEmph() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endEmph() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginUnderline() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endUnderline() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginStrikeout() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endStrikeout() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginForeground(const QBrush &brush) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("").arg(brush.color().name())); -} - -void KTextHTMLBuilder::endForeground() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginBackground(const QBrush &brush) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("").arg(brush.color().name())); -} - -void KTextHTMLBuilder::endBackground() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginAnchor(const QString &href, const QString &name) -{ - Q_D(KTextHTMLBuilder); - if (!href.isEmpty()) { - if (!name.isEmpty()) { - d->m_text.append(QString("").arg(href).arg(name)); - } else { - d->m_text.append(QString("").arg(href)); - } - } else { - if (!name.isEmpty()) { - d->m_text.append(QString("").arg(name)); - } - } -} - -void KTextHTMLBuilder::endAnchor() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginFontFamily(const QString &family) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("").arg(family)); -} - -void KTextHTMLBuilder::endFontFamily() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginFontPointSize(int size) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("").arg(QString::number(size))); -} - -void KTextHTMLBuilder::endFontPointSize() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginParagraph(Qt::Alignment al, qreal topMargin, qreal bottomMargin, qreal leftMargin, qreal rightMargin) -{ - Q_D(KTextHTMLBuilder); - // Don't put paragraph tags inside li tags. Qt bug reported. -// if (currentListItemStyles.size() != 0) -// { - QString styleString; - if (topMargin != 0) { - styleString.append(QString("margin-top:%1;").arg(topMargin)); - } - if (bottomMargin != 0) { - styleString.append(QString("margin-bottom:%1;").arg(bottomMargin)); - } - if (leftMargin != 0) { - styleString.append(QString("margin-left:%1;").arg(leftMargin)); - } - if (rightMargin != 0) { - styleString.append(QString("margin-right:%1;").arg(rightMargin)); - } - - // Using == doesn't work here. - // Using bitwise comparison because an alignment can contain a vertical and a horizontal part. - if (al & Qt::AlignRight) { - d->m_text.append("

m_text.append("

m_text.append("

m_text.append("m_text.append("m_text.append(" \"" + styleString + "\""); - } - d->m_text.append(">"); -// } -} - -void KTextHTMLBuilder::beginHeader(int level) -{ - Q_D(KTextHTMLBuilder); - switch (level) { - case 1: - d->m_text.append("

"); - break; - case 2: - d->m_text.append("

"); - break; - case 3: - d->m_text.append("

"); - break; - case 4: - d->m_text.append("

"); - break; - case 5: - d->m_text.append("

"); - break; - case 6: - d->m_text.append("
"); - break; - default: - break; - } -} - -void KTextHTMLBuilder::endHeader(int level) -{ - Q_D(KTextHTMLBuilder); - switch (level) { - case 1: - d->m_text.append("
"); - break; - case 2: - d->m_text.append("

"); - break; - case 3: - d->m_text.append(""); - break; - case 4: - d->m_text.append(""); - break; - case 5: - d->m_text.append(""); - break; - case 6: - d->m_text.append(""); - break; - default: - break; - } -} - -void KTextHTMLBuilder::endParagraph() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append("

\n"); -} - -void KTextHTMLBuilder::addNewline() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append("
\n"); -} - -void KTextHTMLBuilder::insertHorizontalRule(int width) -{ - Q_D(KTextHTMLBuilder); - if (width != -1) { - d->m_text.append(QString("
\n").arg(width)); - } - d->m_text.append("
\n"); -} - -void KTextHTMLBuilder::insertImage(const QString &src, qreal width, qreal height) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("m_text.append(QString("width=\"%2\" ").arg(width)); - if (height != 0) d->m_text.append(QString("height=\"%2\" ").arg(height)); - d->m_text.append("/>"); -} - -void KTextHTMLBuilder::beginList(QTextListFormat::Style type) -{ - Q_D(KTextHTMLBuilder); - d->currentListItemStyles.append(type); - switch (type) { - case QTextListFormat::ListDisc: - d->m_text.append("
    \n"); - break; - case QTextListFormat::ListCircle: - d->m_text.append("\n
      \n"); - break; - case QTextListFormat::ListSquare: - d->m_text.append("\n
        \n"); - break; - case QTextListFormat::ListDecimal: - d->m_text.append("\n
          \n"); - break; - case QTextListFormat::ListLowerAlpha: - d->m_text.append("\n
            \n"); - break; - case QTextListFormat::ListUpperAlpha: - d->m_text.append("\n
              \n"); - break; - default: - break; - } -} -void KTextHTMLBuilder::endList() -{ - Q_D(KTextHTMLBuilder); - switch (d->currentListItemStyles.last()) { - case QTextListFormat::ListDisc: - case QTextListFormat::ListCircle: - case QTextListFormat::ListSquare: - d->m_text.append("
      \n"); - break; - case QTextListFormat::ListDecimal: - case QTextListFormat::ListLowerAlpha: - case QTextListFormat::ListUpperAlpha: - d->m_text.append("\n"); - break; - default: - break; - } - d->currentListItemStyles.removeLast(); -} -void KTextHTMLBuilder::beginListItem() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append("
    • "); -} - -void KTextHTMLBuilder::endListItem() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append("
    • \n"); -} - -void KTextHTMLBuilder::beginSuperscript() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endSuperscript() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginSubscript() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endSubscript() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - - -void KTextHTMLBuilder::beginTable(qreal cellpadding, qreal cellspacing, const QString &width) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("") - .arg(cellpadding) - .arg(cellspacing) - .arg(width)); -} - -void KTextHTMLBuilder::beginTableRow() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::beginTableHeaderCell(const QString &width, int colspan, int rowspan) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("
      ").arg(width).arg(colspan).arg(rowspan)); -} - -void KTextHTMLBuilder::beginTableCell(const QString &width, int colspan, int rowspan) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(QString("").arg(width).arg(colspan).arg(rowspan)); -} - -void KTextHTMLBuilder::endTable() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append("
      "); -} - -void KTextHTMLBuilder::endTableRow() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endTableHeaderCell() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - -void KTextHTMLBuilder::endTableCell() -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(""); -} - - -void KTextHTMLBuilder::appendLiteralText(const QString &text) -{ - Q_D(KTextHTMLBuilder); - d->m_text.append(Qt::escape(text)); -} - - -QString& KTextHTMLBuilder::getResult() -{ - Q_D(KTextHTMLBuilder); - return d->m_text; -} diff --git a/kpimtextedit/richtextbuilders/ktexthtmlbuilder.h b/kpimtextedit/richtextbuilders/ktexthtmlbuilder.h deleted file mode 100644 index 71456cb6c..000000000 --- a/kpimtextedit/richtextbuilders/ktexthtmlbuilder.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef KHTMLBUILDER_H -#define KHTMLBUILDER_H - -#include "kabstractmarkupbuilder.h" - -class KTextHTMLBuilderPrivate; - -/** -@brief The KTextHTMLBuilder creates a clean html markup output. - -This class creates html output which is as minimal as possible and restricted to the rich text features supported in Qt. (http://doc.trolltech.com/4.4/richtext-html-subset.htm) - -The output contains only the body content, not the head element or other metadata. - -eg: - -@code -

      - This is some formatted content in a paragraph. -

      -@endcode - -instead of the content produced by qt: - -@code - - -

      This is some formatted content in a paragraph.

      -@endcode - -Such tags should be created separately. For example: - -@code - AbstractMarkupBuilder *b = new KTextHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(b); - md->constructContent(); - QString cleanHtml("\n%1\n\n%2\n") - .arg(document.metaInformation(QTextDocument::DocumentTitle)) - .arg(b->getOutput()); - QFile.write(cleanHtml); -@endcode - -Font formatting information on elements is represented by individual span elements. -eg: -@code - Blue text on red background -@endcode -instead of -@code - Blue text on red background -@endcode - It my be possible to change this if necessary. - -@todo Move this to kdelibs when tested and prooven. - -@author Stephen Kelly -@since 4.2 - -*/ -class KTextHTMLBuilder : public KAbstractMarkupBuilder -{ -public: - - /** - Creates a new KTextHTMLBuilder. - */ - KTextHTMLBuilder(); - virtual ~KTextHTMLBuilder(); - - virtual void beginStrong(); - virtual void endStrong(); - virtual void beginEmph(); - virtual void endEmph(); - virtual void beginUnderline(); - virtual void endUnderline(); - virtual void beginStrikeout(); - virtual void endStrikeout(); - virtual void beginForeground(const QBrush &brush); - virtual void endForeground(); - virtual void beginBackground(const QBrush &brush); - virtual void endBackground(); - virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()); - virtual void endAnchor(); - - // Maybe this stuff should just be added to a list, and then when I add literal text, - // add some kind of style attribute in one span instead of many. - virtual void beginFontFamily(const QString &family); - virtual void endFontFamily(); - - /** - Begin a new font point size - @param size The new size to begin. - */ - virtual void beginFontPointSize(int size); - virtual void endFontPointSize(); - - /** - Begin a new paragraph - @param al The new paragraph alignment - @param topMargin The new paragraph topMargin - @param bottomMargin The new paragraph bottomMargin - @param leftMargin The new paragraph leftMargin - @param rightMargin The new paragraph rightMargin - */ - virtual void beginParagraph(Qt::Alignment al = Qt::AlignLeft, qreal topMargin = 0.0, qreal bottomMargin = 0.0, qreal leftMargin = 0.0, qreal rightMargin = 0.0); - - /** - Begin a new header element. - @param level The new level to begin. - */ - virtual void beginHeader(int level); - - /** - End a header element. - @param level The new level to end. - */ - virtual void endHeader(int level); - - virtual void endParagraph(); - virtual void addNewline(); - - virtual void insertHorizontalRule(int width = -1); - - virtual void insertImage(const QString &src, qreal width, qreal height); - - virtual void beginList(QTextListFormat::Style type); - - virtual void endList(); - - virtual void beginListItem(); - virtual void endListItem(); - - virtual void beginSuperscript(); - - virtual void endSuperscript(); - - virtual void beginSubscript(); - - virtual void endSubscript(); - - - virtual void beginTable(qreal cellpadding, qreal cellspacing, const QString &width); - - virtual void beginTableRow(); - virtual void beginTableHeaderCell(const QString &width, int colspan, int rowspan); - - virtual void beginTableCell(const QString &width, int colspan, int rowspan); - - virtual void endTable(); - virtual void endTableRow(); - virtual void endTableHeaderCell(); - virtual void endTableCell(); - - /** - Reimplemented from AbstractMarkupBuilder. - - This implementation escapes the text before appending so that - - @verbatim - A sample bold word. - @endverbatim - - becomes - - @verbatim - A sample <b>bold</b> word. - @endverbatim - - */ - virtual void appendLiteralText(const QString &text); - - - virtual QString& getResult(); - -private: - KTextHTMLBuilderPrivate *d_ptr; - Q_DECLARE_PRIVATE(KTextHTMLBuilder) - -}; - -#endif diff --git a/kpimtextedit/richtextbuilders/main.cpp b/kpimtextedit/richtextbuilders/main.cpp deleted file mode 100644 index df4ac5083..000000000 --- a/kpimtextedit/richtextbuilders/main.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - * KDE Rich Text Editor - * - * Copyright 2008 Stephen Kelly - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301  USA - */ - -#include "krichtexteditor.h" - -#include -#include -#include - -int main(int argc, char **argv) -{ - const QByteArray& ba = QByteArray("krichtexteditor"); - const KLocalizedString name = ki18n("KDE Rich Text Editor"); - KAboutData aboutData(ba, ba, name, ba, name); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - KRichTextEditor* mw = new KRichTextEditor(); - mw->show(); - app.exec(); -} diff --git a/kpimtextedit/richtextbuilders/mediawikimarkupbuilder.cpp b/kpimtextedit/richtextbuilders/mediawikimarkupbuilder.cpp deleted file mode 100644 index 1eadfb7bd..000000000 --- a/kpimtextedit/richtextbuilders/mediawikimarkupbuilder.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "mediawikimarkupbuilder.h" -#include - -MediaWikiMarkupBuilder::MediaWikiMarkupBuilder() {} -MediaWikiMarkupBuilder::~MediaWikiMarkupBuilder() {} - -void MediaWikiMarkupBuilder::beginStrong() -{ - m_text.append("'''"); -} -void MediaWikiMarkupBuilder::endStrong() -{ - m_text.append("'''"); -} -void MediaWikiMarkupBuilder::beginEmph() -{ - m_text.append("''"); -} -void MediaWikiMarkupBuilder::endEmph() -{ - m_text.append("''"); -} -void MediaWikiMarkupBuilder::beginUnderline() -{ - m_text.append(""); -} -void MediaWikiMarkupBuilder::endUnderline() -{ - m_text.append(""); -} -void MediaWikiMarkupBuilder::beginStrikeout() -{ - m_text.append(""); -} -void MediaWikiMarkupBuilder::endStrikeout() -{ - m_text.append(""); -} - -void MediaWikiMarkupBuilder::endParagraph() -{ - m_text.append("\n"); -} -void MediaWikiMarkupBuilder::addNewline() -{ - m_text.append("\n"); -} - -void MediaWikiMarkupBuilder::beginAnchor(const QString &href, const QString &name) -{ - Q_UNUSED(name); - m_text.append(QString("[%1 ").arg(href)); -} -void MediaWikiMarkupBuilder::endAnchor() -{ - m_text.append("]"); -} - -void MediaWikiMarkupBuilder::beginHeader(int level) -{ - switch (level) { - case 1: - m_text.append("= "); - break; - case 2: - m_text.append("== "); - break; - case 3: - m_text.append("=== "); - break; - case 4: - m_text.append("==== "); - break; - case 5: - m_text.append("===== "); - break; - case 6: - m_text.append("====== "); - break; - default: - break; - } -} - -void MediaWikiMarkupBuilder::endHeader(int level) -{ - switch (level) { - case 1: - m_text.append(" =\n"); - break; - case 2: - m_text.append(" ==\n"); - break; - case 3: - m_text.append(" ===\n"); - break; - case 4: - m_text.append(" ====\n"); - break; - case 5: - m_text.append(" =====\n"); - break; - case 6: - m_text.append(" ======\n"); - break; - default: - break; - } -} - -void MediaWikiMarkupBuilder::beginList(QTextListFormat::Style type) -{ - currentListItemStyles.append(type); - switch (type) { - case QTextListFormat::ListDisc: - case QTextListFormat::ListCircle: - case QTextListFormat::ListSquare: - case QTextListFormat::ListDecimal: - case QTextListFormat::ListLowerAlpha: - case QTextListFormat::ListUpperAlpha: - m_text.append("\n"); - break; - default: - break; - } -} - - - -void MediaWikiMarkupBuilder::endList() -{ - m_text.append("\n"); - currentListItemStyles.removeLast(); -} - - -void MediaWikiMarkupBuilder::beginListItem() -{ - - switch (currentListItemStyles.last()) { - case QTextListFormat::ListDisc: - case QTextListFormat::ListCircle: - case QTextListFormat::ListSquare: - m_text.append("* "); // Unordered lists are all disc type in MediaWikiMarkup. - break; - case QTextListFormat::ListDecimal: - case QTextListFormat::ListLowerAlpha: - case QTextListFormat::ListUpperAlpha: - m_text.append("# "); - break; - default: - break; - } -} -void MediaWikiMarkupBuilder::endListItem() -{ - m_text.append("\n"); -} - -void MediaWikiMarkupBuilder::appendLiteralText(const QString &text) -{ - m_text.append(escape(text)); -} - -const QString MediaWikiMarkupBuilder::escape(const QString &s) -{ - if (s.contains("<")) { // TODO: This could contain more. "''" and "[" for example - return QString("" + s + ""); - } - return s; -} - -QString& MediaWikiMarkupBuilder::getResult() -{ - return m_text; -} - - diff --git a/kpimtextedit/richtextbuilders/mediawikimarkupbuilder.h b/kpimtextedit/richtextbuilders/mediawikimarkupbuilder.h deleted file mode 100644 index ba04c19c0..000000000 --- a/kpimtextedit/richtextbuilders/mediawikimarkupbuilder.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#ifndef MEDIAWIKIMARKUPBUILDER_H -#define MEDIAWIKIMARKUPBUILDER_H - - -#include "kabstractmarkupbuilder.h" -#include - - -/** - @brief Creates MediaWiki markup from a QTextDocument -*/ -class MediaWikiMarkupBuilder : public KAbstractMarkupBuilder -{ -public: - - /** - Creates a new MediaWikiMarkupBuilder - */ - MediaWikiMarkupBuilder(); - virtual ~MediaWikiMarkupBuilder(); - - virtual void beginStrong(); - virtual void endStrong(); - virtual void beginEmph(); - virtual void endEmph(); - virtual void beginUnderline(); - virtual void endUnderline(); - virtual void beginStrikeout(); - virtual void endStrikeout(); - - virtual void endParagraph(); - virtual void addNewline(); - - virtual void beginAnchor(const QString &href = QString(), const QString &name = QString()); - virtual void endAnchor(); - - virtual void beginHeader(int level); - virtual void endHeader(int level); - - virtual void beginList(QTextListFormat::Style type); - - - - virtual void endList(); - - - virtual void beginListItem(); - virtual void endListItem(); - - - virtual void appendLiteralText(const QString &text); - - const QString escape(const QString &s); - - virtual QString& getResult(); - -private: - QList currentListItemStyles; - - QString m_text; -}; - -#endif diff --git a/kpimtextedit/richtextbuilders/tests/CMakeLists.txt b/kpimtextedit/richtextbuilders/tests/CMakeLists.txt deleted file mode 100644 index 2e3b9a52a..000000000 --- a/kpimtextedit/richtextbuilders/tests/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -ENABLE_TESTING() -FIND_PACKAGE(KDE4 REQUIRED) -INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ) - -set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) - -SET(krichtexteditorSources - ../kmarkupdirector.cpp - ../kmarkupdirector_p.cpp - ../khtmlbuilder.cpp - ../kplaintextmarkupbuilder.cpp - ) - - -MACRO(KDEUI_UNIT_TESTS) - FOREACH(_testname ${ARGN}) - kde4_add_unit_test(${_testname} ${_testname}.cpp ${krichtexteditorSources} ) - target_link_libraries(${_testname} ${KDE4_KDEUI_LIBS} ${QT_QTTEST_LIBRARY} ${QT_QTXML_LIBRARY} ${KDEWIN32_LIBRARIES} ) - ENDFOREACH(_testname) -ENDMACRO(KDEUI_UNIT_TESTS) - -KDEUI_UNIT_TESTS( - htmlbuildertest - plainmarkupbuildertest -) - diff --git a/kpimtextedit/richtextbuilders/tests/htmlbuildertest.cpp b/kpimtextedit/richtextbuilders/tests/htmlbuildertest.cpp deleted file mode 100644 index ec702279e..000000000 --- a/kpimtextedit/richtextbuilders/tests/htmlbuildertest.cpp +++ /dev/null @@ -1,578 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "../kmarkupdirector.h" -#include "../khtmlbuilder.h" - -class TestHtmlOutput: public QObject -{ - Q_OBJECT -private slots: - -// Test paragraph contents: - void testSingleFormat(); - void testDoubleFormat(); - void testDoubleStartDifferentFinish(); - void testDoubleStartDifferentFinishReverseOrder(); - void testDifferentStartDoubleFinish(); - void testDifferentStartDoubleFinishReverseOrder(); - void testOverlap(); - void testAnchor(); - void testAnchorWithFormattedContent(); - void testAdjacentAnchors(); - void testNestedFormatting(); - void testSpan(); - void testDoubleSpan(); - void testSpanNesting(); - void testEdgeCaseLeft(); - void testEdgeCaseRight(); - void testImage(); - void testImageResized(); - void testEachFormatTagSingly(); - void testHorizontalRule(); - void testNewlines(); - void testEmptyParagraphs(); - void testNewlinesThroughQTextEdit(); - void testBrInsideParagraph(); - -}; - -void TestHtmlOutput::testSingleFormat() -{ - QTextDocument *doc = new QTextDocument(); - - // One format - doc->setHtml("This text is bold."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - QRegExp regex(QString("^

      This text is bold.

      \\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testDoubleFormat() -{ - QTextDocument *doc = new QTextDocument(); - - // One format - doc->setHtml("Some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - QRegExp regex(QString("^

      Some (|)formatted(|) text.

      \\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testAnchor() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("A link to KDE."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex(QString("^

      A link to KDE.

      \\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testAnchorWithFormattedContent() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("A formatted link to KDE."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - -// kDebug() << result; - - QRegExp regex(QString("^

      A formatted link to KDE.

      \\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testAdjacentAnchors() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Two linksnext to eachother."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex(QString("^

      Two linksnext to eachother.

      \\n$")); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testNestedFormatting() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("This text is italic and bold."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex(QString("^

      This text is italic and bold.

      \\n$")); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testSpan() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testDoubleSpan() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testSpanNesting() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted nested text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted nested text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testDoubleStartDifferentFinish() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testDoubleStartDifferentFinishReverseOrder() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testDifferentStartDoubleFinish() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testDifferentStartDoubleFinishReverseOrder() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testOverlap() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testEdgeCaseLeft() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testEdgeCaseRight() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with some formatted text.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testImage() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with an inline image."); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Paragraph with an inline image.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testImageResized() -{ - QString result; - QRegExp regex; - KHTMLBuilder *hb; - KMarkupDirector *md; - QTextDocument *doc = new QTextDocument(); - - // width - doc->setHtml("Paragraph with an inline image."); - - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Paragraph with an inline image.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // height - doc->setHtml("Paragraph with an inline image."); - - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Paragraph with an inline image.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // height and width - doc->setHtml("Paragraph with an inline image."); - - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Paragraph with an inline image.

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testEachFormatTagSingly() -{ - QString result; - QRegExp regex; - KHTMLBuilder *hb; - KMarkupDirector *md; - QTextDocument *doc = new QTextDocument(); - - - // Test bold - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - - // Test Italic - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Underline - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Strikeout - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Superscript - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Subscript - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Foreground - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - - // Test Background - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Font Family - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Font Size - doc->setHtml("Some formatted text."); - hb = new KHTMLBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^

      Some formatted text.

      \\n$"); - QVERIFY(regex.exactMatch(result)); - -} - -void TestHtmlOutput::testHorizontalRule() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo


      Bar

      "); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Foo

      \\n
      \\n

      Bar

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testNewlines() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo

      \n

      \n

      Bar

      "); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Foo

      \\n
      \\n
      \\n

      Bar

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testEmptyParagraphs() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo

      \n

      \n

      Bar

      "); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Foo

      \\n
      \\n
      \\n

      Bar

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput::testNewlinesThroughQTextEdit() -{ - - QTextEdit *te = new QTextEdit(); - QTextCursor cursor = te->textCursor(); - cursor.movePosition(QTextCursor::Start); - cursor.insertText("Foo"); - cursor.insertText("\n"); - cursor.insertText("\n"); - cursor.insertText("\n"); - cursor.insertText("Bar"); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(te->document()); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^

      Foo

      \\n
      \\n
      \\n

      Bar

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestHtmlOutput:: testBrInsideParagraph() -{ - - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo


      Bar

      "); - - KHTMLBuilder *hb = new KHTMLBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - // Two paragraphs separated by two line breaks - - QRegExp regex = QRegExp("^

      Foo

      \\n
      \\n
      \\n

      Bar

      \\n$"); - - QVERIFY(regex.exactMatch(result)); -} - - -QTEST_KDEMAIN(TestHtmlOutput, GUI) -#include "htmlbuildertest.moc" diff --git a/kpimtextedit/richtextbuilders/tests/plainmarkupbuildertest.cpp b/kpimtextedit/richtextbuilders/tests/plainmarkupbuildertest.cpp deleted file mode 100644 index f7474c9b1..000000000 --- a/kpimtextedit/richtextbuilders/tests/plainmarkupbuildertest.cpp +++ /dev/null @@ -1,587 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "../kmarkupdirector.h" -#include "../kplaintextmarkupbuilder.h" -#include "../khtmlbuilder.h" - -class TestPlainMarkupOutput: public QObject -{ - Q_OBJECT -private slots: - -// Test paragraph contents: - void testSingleFormat(); - void testDoubleFormat(); - void testDoubleStartDifferentFinish(); - void testDoubleStartDifferentFinishReverseOrder(); - void testDifferentStartDoubleFinish(); - void testDifferentStartDoubleFinishReverseOrder(); - void testOverlap(); - void testAnchor(); - void testAnchorWithFormattedContent(); - void testAdjacentAnchors(); - void testNestedFormatting(); - void testSpan(); - void testDoubleSpan(); - void testSpanNesting(); - void testEdgeCaseLeft(); - void testEdgeCaseRight(); - void testImage(); - void testImageResized(); - void testEachFormatTagSingly(); - void testHorizontalRule(); - void testNewlines(); - void testEmptyParagraphs(); - void testNewlinesThroughQTextEdit(); - void testBrInsideParagraph(); - -}; - -void TestPlainMarkupOutput::testSingleFormat() -{ - QTextDocument *doc = new QTextDocument(); - - // One format - doc->setHtml("This text is bold."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - QRegExp regex(QString("^This \\*text\\* is bold.\\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testDoubleFormat() -{ - QTextDocument *doc = new QTextDocument(); - - // One format - doc->setHtml("Some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - QRegExp regex(QString("^Some (\\*/|/\\*)formatted(\\*/|/\\*) text.\\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testAnchor() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("A link to KDE."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex(QString("^A link\\[1\\] to KDE.\\n\\n---- References ----\\n\\[1\\] http://www.kde.org\\n$")); - - regex.exactMatch(result); - - - QVERIFY(regex.exactMatch(result)); - - -} - -void TestPlainMarkupOutput::testAnchorWithFormattedContent() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("A formatted link to KDE."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - - QRegExp regex(QString("^A \\*formatted\\* link\\[1\\] to KDE.\\n\\n---- References ----\\n\\[1\\] http://www.kde.org\\n$")); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testAdjacentAnchors() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Two linksnext to eachother."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex(QString("^Two links\\[1\\]next\\[2\\] to eachother.\\n\\n---- References ----\\n\\[1\\] http://www.kde.org\\n\\[2\\] http://www.google.com\\n$")); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testNestedFormatting() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("This text is italic and bold."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex(QString("^This \\*text is /italic/ and\\* bold.\\n$")); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testSpan() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Some formatted text.\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testDoubleSpan() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - - QRegExp regex = QRegExp("^Some formatted text.\\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testSpanNesting() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted nested text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Paragraph with some formatted nested text.\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testDoubleStartDifferentFinish() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Paragraph /\\*with\\* some formatted/ text.\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testDoubleStartDifferentFinishReverseOrder() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Paragraph \\*/with/ some formatted\\* text.\\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testDifferentStartDoubleFinish() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Paragraph /with some \\*formatted\\*/ text.\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testDifferentStartDoubleFinishReverseOrder() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - - QRegExp regex = QRegExp("^Paragraph \\*with some /formatted/\\* text.\\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testOverlap() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - - QRegExp regex = QRegExp("^Paragraph \\*with /some/\\*/ formatted/ text.\\n$"); - - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testEdgeCaseLeft() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Paragraph \\*with some formatted text.\\*\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testEdgeCaseRight() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with some formatted text."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^\\*Paragraph with some formatted\\* text.\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testImage() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("Paragraph with an inline image."); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Paragraph with an inline \\[1\\] image.\\n\\n---- References ----\\n\\[1\\] http://kde.org/img/kde41.png\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testImageResized() -{ - QString result; - QRegExp regex; - KPlainTextMarkupBuilder *hb; - KMarkupDirector *md; - QTextDocument *doc = new QTextDocument(); - - // width - doc->setHtml("Paragraph with an inline image."); - - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - - regex = QRegExp("^Paragraph with an inline \\[1\\] image.\\n\\n---- References ----\\n\\[1\\] http://kde.org/img/kde41.png\\n$"); - QVERIFY(regex.exactMatch(result)); - - // height - doc->setHtml("Paragraph with an inline image."); - - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Paragraph with an inline \\[1\\] image.\\n\\n---- References ----\\n\\[1\\] http://kde.org/img/kde41.png\\n$"); - QVERIFY(regex.exactMatch(result)); - - // height and width - doc->setHtml("Paragraph with an inline image."); - - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Paragraph with an inline \\[1\\] image.\\n\\n---- References ----\\n\\[1\\] http://kde.org/img/kde41.png\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testEachFormatTagSingly() -{ - QString result; - QRegExp regex; - KPlainTextMarkupBuilder *hb; - KMarkupDirector *md; - QTextDocument *doc = new QTextDocument(); - - - // Test bold - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some \\*formatted\\* text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - - // Test Italic - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some /formatted/ text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Underline - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some _formatted_ text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Strikeout - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some -formatted- text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Superscript - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some \\^\\{formatted\\} text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Subscript - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some _\\{formatted\\} text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Foreground - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some formatted text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - - // Test Background - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some formatted text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Font Family - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some formatted text.\\n$"); - QVERIFY(regex.exactMatch(result)); - - // Test Font Size - doc->setHtml("Some formatted text."); - hb = new KPlainTextMarkupBuilder(); - md = new KMarkupDirector(hb); - md->constructContent(doc); - result = hb->getResult(); - - regex = QRegExp("^Some formatted text.\\n$"); - QVERIFY(regex.exactMatch(result)); - -} - -void TestPlainMarkupOutput::testHorizontalRule() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo


      Bar

      "); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - - QRegExp regex = QRegExp("^Foo\\n--------------------\\nBar\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testNewlines() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo

      \n

      \n

      Bar

      "); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Foo\\n\\n\\nBar\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testEmptyParagraphs() -{ - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo

      \n

      \n

      Bar

      "); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Foo\\n\\n\\nBar\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput::testNewlinesThroughQTextEdit() -{ - - QTextEdit *te = new QTextEdit(); - QTextCursor cursor = te->textCursor(); - cursor.movePosition(QTextCursor::Start); - cursor.insertText("Foo"); - cursor.insertText("\n"); - cursor.insertText("\n"); - cursor.insertText("\n"); - cursor.insertText("Bar"); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(te->document()); - QString result = hb->getResult(); - - QRegExp regex = QRegExp("^Foo\\n\\n\\nBar\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - -void TestPlainMarkupOutput:: testBrInsideParagraph() -{ - - QTextDocument *doc = new QTextDocument(); - doc->setHtml("

      Foo


      Bar

      "); - - KPlainTextMarkupBuilder *hb = new KPlainTextMarkupBuilder(); - KMarkupDirector *md = new KMarkupDirector(hb); - md->constructContent(doc); - QString result = hb->getResult(); - - // Two paragraphs separated by two line breaks - - QRegExp regex = QRegExp("^Foo\\n\\n\\nBar\\n$"); - - QVERIFY(regex.exactMatch(result)); -} - - -QTEST_KDEMAIN(TestPlainMarkupOutput, GUI) -#include "plainmarkupbuildertest.moc" diff --git a/kpimtextedit/richtextbuilders/tests/richtest.html b/kpimtextedit/richtextbuilders/tests/richtest.html deleted file mode 100644 index 2cdb3d249..000000000 --- a/kpimtextedit/richtextbuilders/tests/richtest.html +++ /dev/null @@ -1,325 +0,0 @@ - -

      Easy stuff

      -

      One format

      -

      A bold part. -

      -

      An italic part. -

      -

      An underlined part. -

      -

      A striked out part. -

      - -

      the color blue.

      - -

      the backbround color red.

      - -

      the courier font.

      - -

      Very large text - -

      Two formats

      -

      A bold/italic part. -

      -

      A bold/underlined part. -

      -

      An underlined/striked part. -

      -

      A Bold/striked out part. -

      - -

      Two formats at edges

      -

      A bold/italic part. -

      -

      A bold/underlined part. -

      - -

      Format boundaries

      -

      An adjacent boldunderlined part. -

      -

      An overlapping bold and underlined part. -

      -

      Bold inside underlined part. -

      - -

      Lists

      -

      Unordered lists

      -Disc: -
        -
      • this
      • -
      • that
      • -
      • these
      • -
      • those
      • -
      - -Circle: -
        -
      • this
      • -
      • that
      • -
      • these
      • -
      • those
      • -
      - -Square: -
        -
      • this
      • -
      • that
      • -
      • these
      • -
      • those
      • -
      - -

      Ordered lists

      - -Decimal: -
        -
      1. this
      2. -
      3. that
      4. -
      5. these
      6. -
      7. those
      8. -
      - -Alpha lowercase: -
        -
      1. this
      2. -
      3. that
      4. -
      5. these
      6. -
      7. those
      8. -
      - -Alpha uppercase: -
        -
      1. this
      2. -
      3. that
      4. -
      5. these
      6. -
      7. those
      8. -
      - -

      Nested lists

      - -
        -
      1. this
      2. -
      3. -
          -
        • Fizz
        • -
        • Bang
        • -
        • Crash
        • -
        • Wallop
        • -
        -
      4. -
      5. these
      6. -
          -
        • nest
        • -
            -
          • nested
          • -
              -
            • dumb
            • -
                -
              • dumber
              • -
              -
            -
          -
        -
      7. those
      8. -
      - -

      Images

      - -A local image: - -A remote image: - -

      Links

      -A named link to google. - -A raw link to http://pim.google.com. - -An image link to . - -Another named link. - -Another link to The google homepage. - -A formatted link. - -

      Tables

      - -

      Tables with no defined width attributes

      -Simple grid: - - - -
      one-oneone-two
      two-onetwo-two
      - -Simple grid with colspan: - - - -
      one-one and one-twoone-three
      two-onetwo-twotwo-three
      - -Simple grid with rowspan: - - - - -
      one-one and two-oneone-three
      two-two
      three-onethree-two
      - -Simple grid with missing bottom right cell. - - - -
      one-oneone-two
      two-one
      - -Table with header: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with wide content: - - - -
      one-oneone-twoLorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
      two-onetwo-twoLorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
      - - -Table with formatted contents: - - - -
      bolda link.
      big textanother font
      - -Table with nested table: - - - - -
      Col1Col2
      one-oneone-two
      two-one - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      -
      - -

      Tables with widths defined

      -Table with 50 percent width - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 50 percent width and 70% first column width - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 50 percent width and 100px first column width - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 100px first column width: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 10% first column width (makes second column 9 times wider): - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 10% first column width on the first row and 20% width on the next row: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 300px width: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 300px width, first column width 100px, second column width 200px: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -

      Tables with non matching fixed widths

      - -Table with 300px width, first column width 100px, second column width 100px: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 300px width, first column width 75px, second column width 225px: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - -Table with 300px width, first column width 75px, second column width 150px: - - - - -
      Col1Col2
      one-oneone-two
      two-onetwo-two
      - - -

      Paragraph formatting

      - -

      Left aligned paragraph. (Reversed in RTL).

      -

      -Lorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

      - -

      Right aligned paragraph. (Reversed in RTL).

      -

      -Lorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

      - -

      Center aligned paragraph.

      -

      -Lorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

      - -

      Justified paragraph.

      -

      -Lorem Ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

      - -

      lorem ipsum

      -

      -Margin above this paragraph. No margin below. -

      -

      -Margin below this paragraph. No margin above. -

      -

      lorem ipsum

      - -

      Other document formatting

      - -A horizontal line: -
      -

      -A line withsuperscript andsubscript. -

      - - \ No newline at end of file